SenderManager { public boolean sendAlert(AlertChannel channel, AlertMessageEntity message) { String channelId = channel.getId(); Sender sender = senders.get(channelId); try { boolean result = sender.send(message); logger.debug("[sendAlert] Channel: {}, message: {}, send out: {}", channel, message.getTitle(), result); return result; } catch (Exception e) { logger.error("[sendAlert]", e); return false; } }  Sender querySender(String id); boolean sendAlert(AlertChannel channel, AlertMessageEntity message);  }
@Test public void sendAlert() throws Exception { String title = "Test"; String content = "Test Content"; List<String> recepients = Arrays.asList("test1@gmail.com, test2@gmail.com"); senderManager.sendAlert(AlertChannel.MAIL, new AlertMessageEntity(title, content, recepients)); }