@Test
public void shouldBeAbleToInjectEventAndFireNewEvent() throws Exception
{
ExtensionWithEvent target = new ExtensionWithEvent();
Extension extension = ExtensionImpl.of(target);
Assert.assertEquals(
"Verify correct event fields were found",
1, extension.getEventPoints().size());
Assert.assertEquals(1, extension.getObservers().size());
DummyEventImpl event = new DummyEventImpl();
for(EventPoint point : extension.getEventPoints())
{
point.set(event);
}
extension.getObservers().get(0).invoke(null, new Object());
Assert.assertTrue(target.methodOneWasCalled);
Assert.assertEquals(
"Verify the Extensions Event was firable",
"some string", event.getString());