@Test
public void sendEmailTest() throws Exception {

    CompletableFuture<Set<String>> cf = es.sendEmail(SUBJECT_LINE, HTML_MESSAGE, TO_EMAIL_ADDRESS);
    assertEquals(0, cf.get().size());
    List<SmtpMessage> emails = smtpServer.getReceivedEmails();
    assertEquals(1, emails.size());
    SmtpMessage email = emails.get(0);
    assertEquals(SUBJECT_LINE, email.getHeaderValue("Subject"));
    assertEquals(TO_EMAIL_ADDRESS, email.getHeaderValue("From"));
    assertTrue(email.getBody().contains(TEXT_MESSAGE));
}