@Test public final void shouldSendPlainTextEmail() throws Exception { ArgumentCaptor<MimeMessage> mailMessageCaptor = ArgumentCaptor.forClass(MimeMessage.class); mailServiceImpl.sendEmail(DEFAULT_RECIPIENT, DEFAULT_SUBJECT, DEFAULT_BODY); verify(mailSender, Mockito.times(1)).send(mailMessageCaptor.capture()); verify(mimeMessage).setFrom(new InternetAddress(DEFAULT_SENDER)); verify(mimeMessage).setRecipient(Message.RecipientType.TO, new InternetAddress(DEFAULT_RECIPIENT)); verify(mimeMessage).setSubject(DEFAULT_SUBJECT); verify(mimeMessage).setContent(DEFAULT_BODY, "text/html"); }
@Override public void sendEmail(final String recipient, final String subject, final String body) { sendHtmlTextEmail(getDefaultSender(), recipient, subject, body); }
MailServiceImpl implements MailService { @Override public void sendEmail(final String recipient, final String subject, final String body) { sendHtmlTextEmail(getDefaultSender(), recipient, subject, body); } }
MailServiceImpl implements MailService { @Override public void sendEmail(final String recipient, final String subject, final String body) { sendHtmlTextEmail(getDefaultSender(), recipient, subject, body); }  }
MailServiceImpl implements MailService { @Override public void sendEmail(final String recipient, final String subject, final String body) { sendHtmlTextEmail(getDefaultSender(), recipient, subject, body); }  @Override void sendEmail(final String recipient, final String subject, final String body); static boolean isValidEmail(final String email); }
MailServiceImpl implements MailService { @Override public void sendEmail(final String recipient, final String subject, final String body) { sendHtmlTextEmail(getDefaultSender(), recipient, subject, body); }  @Override void sendEmail(final String recipient, final String subject, final String body); static boolean isValidEmail(final String email);  }