@Test public void testMetrics_sendMessageToTwoRecipients() { setNewMetrics(); try { boolean isSent = confirmationServiceImpl.sendMessage(mailMessageWithTwoRecipientsMock); assertTrue("last sent message should be successful", isSent); double successRate = getSuccessRate(); assertEquals(0.5, successRate, 0); assertEquals(2, getAllSent()); assertEquals(1, getSentFailed()); } catch (InvalidAddressException e) { } }
@Override @Retryable public boolean sendMessage(MailMessage message) throws InvalidAddressException { boolean delivered = false; if (message.hasCC() && !message.getToEmailAddresses().contains(message.getCCEmailAddress())) { delivered = sendToOneRecipient(message, message.getCCEmailAddress()); } message.setNoCC(); List<String> toEmailAddresses = message.getToEmailAddresses(); for (String toEmailAddress : toEmailAddresses) { delivered = sendToOneRecipient(message, toEmailAddress); } return delivered; }
ConfirmationServiceImpl extends CoreBaseService<ConfirmationServiceMetric<ConfirmationServiceContext>, ConfirmationServiceContext> implements
        ConfirmationService { @Override @Retryable public boolean sendMessage(MailMessage message) throws InvalidAddressException { boolean delivered = false; if (message.hasCC() && !message.getToEmailAddresses().contains(message.getCCEmailAddress())) { delivered = sendToOneRecipient(message, message.getCCEmailAddress()); } message.setNoCC(); List<String> toEmailAddresses = message.getToEmailAddresses(); for (String toEmailAddress : toEmailAddresses) { delivered = sendToOneRecipient(message, toEmailAddress); } return delivered; } }
ConfirmationServiceImpl extends CoreBaseService<ConfirmationServiceMetric<ConfirmationServiceContext>, ConfirmationServiceContext> implements
        ConfirmationService { @Override @Retryable public boolean sendMessage(MailMessage message) throws InvalidAddressException { boolean delivered = false; if (message.hasCC() && !message.getToEmailAddresses().contains(message.getCCEmailAddress())) { delivered = sendToOneRecipient(message, message.getCCEmailAddress()); } message.setNoCC(); List<String> toEmailAddresses = message.getToEmailAddresses(); for (String toEmailAddress : toEmailAddresses) { delivered = sendToOneRecipient(message, toEmailAddress); } return delivered; }  }
ConfirmationServiceImpl extends CoreBaseService<ConfirmationServiceMetric<ConfirmationServiceContext>, ConfirmationServiceContext> implements
        ConfirmationService { @Override @Retryable public boolean sendMessage(MailMessage message) throws InvalidAddressException { boolean delivered = false; if (message.hasCC() && !message.getToEmailAddresses().contains(message.getCCEmailAddress())) { delivered = sendToOneRecipient(message, message.getCCEmailAddress()); } message.setNoCC(); List<String> toEmailAddresses = message.getToEmailAddresses(); for (String toEmailAddress : toEmailAddresses) { delivered = sendToOneRecipient(message, toEmailAddress); } return delivered; }  @Override boolean sendConfirmation(ConfirmationInfo confirmationInfo); @Override @Retryable boolean sendMessage(MailMessage message); }
ConfirmationServiceImpl extends CoreBaseService<ConfirmationServiceMetric<ConfirmationServiceContext>, ConfirmationServiceContext> implements
        ConfirmationService { @Override @Retryable public boolean sendMessage(MailMessage message) throws InvalidAddressException { boolean delivered = false; if (message.hasCC() && !message.getToEmailAddresses().contains(message.getCCEmailAddress())) { delivered = sendToOneRecipient(message, message.getCCEmailAddress()); } message.setNoCC(); List<String> toEmailAddresses = message.getToEmailAddresses(); for (String toEmailAddress : toEmailAddresses) { delivered = sendToOneRecipient(message, toEmailAddress); } return delivered; }  @Override boolean sendConfirmation(ConfirmationInfo confirmationInfo); @Override @Retryable boolean sendMessage(MailMessage message);  }