use of com.tvd12.ezyfoxserver.command.impl.EzyBroadcastEventImpl in project ezyfox-server by youngmonkeys.
the class EzyBroadcastEventImplTest method test.
@Test
public void test() {
EzyServerContext serverContext = mock(EzyServerContext.class);
EzyZoneContext zoneContext1 = mock(EzyZoneContext.class);
EzyZoneContext zoneContext2 = mock(EzyZoneContext.class);
doThrow(new IllegalStateException()).when(zoneContext2).handleEvent(any(), any());
when(serverContext.getZoneContexts()).thenReturn(Lists.newArrayList(zoneContext1, zoneContext2));
EzyBroadcastEventImpl cmd = new EzyBroadcastEventImpl(serverContext);
EzyServerInitializingEvent event = new EzySimpleServerInitializingEvent();
cmd.fire(EzyEventType.SERVER_INITIALIZING, event, true);
try {
cmd.fire(EzyEventType.SERVER_INITIALIZING, event, false);
} catch (Exception e) {
assert e instanceof IllegalStateException;
}
}
Aggregations