### Question:
EventPublisherApplicationAdapter implements Application { @Override public void onLogon(SessionID sessionId) { publishEvent(Logon.of(sessionId)); } EventPublisherApplicationAdapter(ApplicationEventPublisher applicationEventPublisher); @Override void fromAdmin(Message message, SessionID sessionId); @Override void fromApp(Message message, SessionID sessionId); @Override void onCreate(SessionID sessionId); @Override void onLogon(SessionID sessionId); @Override void onLogout(SessionID sessionId); @Override void toAdmin(Message message, SessionID sessionId); @Override void toApp(Message message, SessionID sessionId);  }### Answer:
@Test public void shouldPublishLogonMessage() { SessionID sessionId = mock(SessionID.class); clientApplication.onLogon(sessionId); await().atMost(FIVE_SECONDS).until(() -> receivedEvents.size() > 0); assertThat(receivedEvents.get(0)).isInstanceOf(Logon.class); assertThat(((Logon) receivedEvents.get(0)).getSessionId()).isEqualTo(sessionId); }