7172737475767778798081
Collection<State> states = new LinkedList<State>(); states.add(gameState()); states.add(menuState()); StateManager stateManager = new StateManager(states); bus.register(stateManager, null); bus.broadcast(new StateChange(MenuState.class)); return stateManager; } public @Bean GameState gameState() {
5354555657585960616263
@Test public void unsubscribedMessagesBroadcastNowhereSilently() { Bus bus = new BusImpl(); bus.broadcast("buzz"); } @Test public void registrationsTakeIntoAccountSuperClass() {
6768697071727374757677
UUID entityId = UUID.randomUUID(); Bar bar = new Bar(bus, entityId); bus.register(bar, entityId); bus.broadcast("blah"); assertEquals("blah", bar.fooValue); assertEquals("blah", bar.barValue); }