### Question:
Dashboard extends BorderPane { @EventListener public void onSetActiveDashboardItem(SetActiveDashboardItemRequest request) { DashboardItemPane requested = items.get(request.getActiveItemId()); if (requested != null) { center.getChildren().setAll(requested); fade.play(); eventStudio().broadcast(new SetTitleEvent(requested.getItem().name())); } } @Inject  Dashboard(List<DashboardItem> itemsList, QuickbarDashboardButtonsPane dashboardButtons); @EventListener void onSetActiveDashboardItem(SetActiveDashboardItemRequest request); boolean hasItem(String id);  }### Answer:
@Test public void wrongModuleDoesntBoom() { try (Injector injector = Injector.start(new Config())) { Dashboard victim = injector.instance(Dashboard.class); victim.onSetActiveDashboardItem(new SetActiveDashboardItemRequest("chuck norris")); } }
@Test public void eventIsSent() { try (Injector injector = Injector.start(new Config())) { Dashboard victim = injector.instance(Dashboard.class); assertTrue(((StackPane) victim.getCenter()).getChildren().isEmpty()); Listener<SetTitleEvent> listener = mock(Listener.class); eventStudio().add(SetTitleEvent.class, listener); victim.onSetActiveDashboardItem( new SetActiveDashboardItemRequest(injector.instance(AboutDashboadItem.class).id())); verify(listener).onEvent(any()); assertFalse(((StackPane) victim.getCenter()).getChildren().isEmpty()); } }