@Test public void sendMessage() { deliveryNotificationSenderManager.sendMessage(delivery); verify(deliveryKakaoNotificationSender, atLeastOnce()).send(any(DeliveryMessageDto.Message.class)); verify(deliverySmsNotificationSender, atLeastOnce()).send(any(DeliveryMessageDto.Message.class)); }
public void sendMessage(Delivery delivery) { final List<DeliveryNotificationType> notifications = delivery.getDeliveryNotificationTypes(); if (!notifications.isEmpty()) for (DeliveryNotificationType type : notifications) getInstanceByType(type).send(buildMessage(delivery)); }
DeliveryNotificationSenderManager { public void sendMessage(Delivery delivery) { final List<DeliveryNotificationType> notifications = delivery.getDeliveryNotificationTypes(); if (!notifications.isEmpty()) for (DeliveryNotificationType type : notifications) getInstanceByType(type).send(buildMessage(delivery)); } }
DeliveryNotificationSenderManager { public void sendMessage(Delivery delivery) { final List<DeliveryNotificationType> notifications = delivery.getDeliveryNotificationTypes(); if (!notifications.isEmpty()) for (DeliveryNotificationType type : notifications) getInstanceByType(type).send(buildMessage(delivery)); } @Autowired  DeliveryNotificationSenderManager(DeliveryNotificationSenderFactory deliveryNotificationSenderFactory); }
DeliveryNotificationSenderManager { public void sendMessage(Delivery delivery) { final List<DeliveryNotificationType> notifications = delivery.getDeliveryNotificationTypes(); if (!notifications.isEmpty()) for (DeliveryNotificationType type : notifications) getInstanceByType(type).send(buildMessage(delivery)); } @Autowired  DeliveryNotificationSenderManager(DeliveryNotificationSenderFactory deliveryNotificationSenderFactory); void sendMessage(Delivery delivery); }
DeliveryNotificationSenderManager { public void sendMessage(Delivery delivery) { final List<DeliveryNotificationType> notifications = delivery.getDeliveryNotificationTypes(); if (!notifications.isEmpty()) for (DeliveryNotificationType type : notifications) getInstanceByType(type).send(buildMessage(delivery)); } @Autowired  DeliveryNotificationSenderManager(DeliveryNotificationSenderFactory deliveryNotificationSenderFactory); void sendMessage(Delivery delivery);  }