### Question:
ApplicationContextEventBroker implements ApplicationListener<ApplicationEvent> { @Override public void onApplicationEvent(ApplicationEvent event) { logger.debug(String.format("Propagating application event [%s] to event bus [%s]", event, this)); eventBus.publish(event.getSource(), event); } ApplicationContextEventBroker(EventBus eventBus); @Override void onApplicationEvent(ApplicationEvent event);  }### Answer:
@Test public void testOnApplicationEvent() { ApplicationEvent event = new ApplicationEvent(this) { private static final long serialVersionUID = 7475015652750718692L; @Override public Object getSource() { return "mySource"; } }; EventBus eventBus = mock(EventBus.class); new ApplicationContextEventBroker(eventBus).onApplicationEvent(event); verify(eventBus).publish("mySource", event); }