@Test public void logNotification () throws Exception { ChaosNotification messageNotif = ChaosMessage.builder() .withTitle(TITLE) .withMessage(MESSAGE) .withNotificationLevel(NotificationLevel.GOOD) .build(); String recipients = USER_1 + "," + USER_2; String conferenceRooms = ROOM_1 + "," + ROOM_2; XMPPNotificationService.AddressBook book = new XMPPNotificationService.AddressBook(recipients, conferenceRooms); AbstractXMPPConnection abstractXMPPConnection = Mockito.mock(AbstractXMPPConnection.class); doReturn(abstractXMPPConnection).when(xmppNotification).getConnection(); MultiUserChat multiUserChat = Mockito.mock(MultiUserChat.class); doReturn(multiUserChat).when(xmppNotification).getMultiUserChat(any(), any()); xmppNotification.setAddressBook(book); xmppNotification.logNotification(messageNotif); verify(xmppNotification, times(2)).sendDirectMessage(any(), any()); verify(xmppNotification, times(2)).sendMultiUserMessage(any(), any()); verify(xmppNotification, times(4)).getConnection(); }
@Override public void logNotification (ChaosNotification notification) { Message msg = buildMessage(notification); sendDirectNotifications(msg); sendRoomNotifications(msg); }
XMPPNotification implements NotificationMethods { @Override public void logNotification (ChaosNotification notification) { Message msg = buildMessage(notification); sendDirectNotifications(msg); sendRoomNotifications(msg); } }
XMPPNotification implements NotificationMethods { @Override public void logNotification (ChaosNotification notification) { Message msg = buildMessage(notification); sendDirectNotifications(msg); sendRoomNotifications(msg); } @Autowired  XMPPNotification(); }
XMPPNotification implements NotificationMethods { @Override public void logNotification (ChaosNotification notification) { Message msg = buildMessage(notification); sendDirectNotifications(msg); sendRoomNotifications(msg); } @Autowired  XMPPNotification(); @Override void logNotification(ChaosNotification notification); }
XMPPNotification implements NotificationMethods { @Override public void logNotification (ChaosNotification notification) { Message msg = buildMessage(notification); sendDirectNotifications(msg); sendRoomNotifications(msg); } @Autowired  XMPPNotification(); @Override void logNotification(ChaosNotification notification);  }