@Test public void sendMessage () { NotificationManager notificationManager = new NotificationManager(notificationMethodList); notificationManager.sendNotification(chaosMessage); verify(notificationMethod, times(1)).logNotification(chaosMessage); }
public void sendNotification (ChaosNotification chaosNotification) { if (notificationMethods != null) { for (NotificationMethods notif : notificationMethods) { notif.logNotification(chaosNotification); } } }
NotificationManager { public void sendNotification (ChaosNotification chaosNotification) { if (notificationMethods != null) { for (NotificationMethods notif : notificationMethods) { notif.logNotification(chaosNotification); } } } }
NotificationManager { public void sendNotification (ChaosNotification chaosNotification) { if (notificationMethods != null) { for (NotificationMethods notif : notificationMethods) { notif.logNotification(chaosNotification); } } } @Autowired private  NotificationManager();   NotificationManager(Collection<NotificationMethods> notificationMethods); }
NotificationManager { public void sendNotification (ChaosNotification chaosNotification) { if (notificationMethods != null) { for (NotificationMethods notif : notificationMethods) { notif.logNotification(chaosNotification); } } } @Autowired private  NotificationManager();   NotificationManager(Collection<NotificationMethods> notificationMethods); void sendNotification(ChaosNotification chaosNotification); @Scheduled(initialDelay = 1000 * 60, fixedDelay = 1000 * 5) void flushBuffers(); }
NotificationManager { public void sendNotification (ChaosNotification chaosNotification) { if (notificationMethods != null) { for (NotificationMethods notif : notificationMethods) { notif.logNotification(chaosNotification); } } } @Autowired private  NotificationManager();   NotificationManager(Collection<NotificationMethods> notificationMethods); void sendNotification(ChaosNotification chaosNotification); @Scheduled(initialDelay = 1000 * 60, fixedDelay = 1000 * 5) void flushBuffers();  }