@Test public void shouldPublishFromAdminMessage() throws Exception { Message message = mock(Message.class); SessionID sessionId = mock(SessionID.class); clientApplication.fromAdmin(message, sessionId); await().atMost(FIVE_SECONDS).until(() -> receivedEvents.size() == 1); assertThat(receivedEvents.get(0)).isInstanceOf(FromAdmin.class); assertThat(((FromAdmin) receivedEvents.get(0)).getMessage()).isEqualTo(message); assertThat(((FromAdmin) receivedEvents.get(0)).getSessionId()).isEqualTo(sessionId); }
@Override public void fromAdmin(Message message, SessionID sessionId) { publishEvent(FromAdmin.of(message, sessionId)); }
EventPublisherApplicationAdapter implements Application { @Override public void fromAdmin(Message message, SessionID sessionId) { publishEvent(FromAdmin.of(message, sessionId)); } }
EventPublisherApplicationAdapter implements Application { @Override public void fromAdmin(Message message, SessionID sessionId) { publishEvent(FromAdmin.of(message, sessionId)); } EventPublisherApplicationAdapter(ApplicationEventPublisher applicationEventPublisher); }
EventPublisherApplicationAdapter implements Application { @Override public void fromAdmin(Message message, SessionID sessionId) { publishEvent(FromAdmin.of(message, 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); }
EventPublisherApplicationAdapter implements Application { @Override public void fromAdmin(Message message, SessionID sessionId) { publishEvent(FromAdmin.of(message, 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);  }