SMTPEmailer implements Emailer { @Override public void sendAsHtml(String subject, String body, String... recipients) { sendEmail(subject, body, true, recipients); } SMTPEmailer(JavaMailSenderImpl emailService,
                         String fromAddress); @Override void send(String subject, String body, String... recipients); @Override void sendAsHtml(String subject, String body, String... recipients);  }
@Test public void testSendAsHtml() throws MessagingException { setupMailer(); mimeMessage.setContent("body text", "text/html"); replayAll(); SMTPEmailer emailer = new SMTPEmailer(mailSender, fromAddressString); String subject = "subject"; String body = "body text"; String[] recipients = {toAddressString}; emailer.sendAsHtml(subject, body, recipients); }