@Test
public void testWithDefaultFrom() throws Exception {

    // given
    SmtpConfigDto configDto = ImmutableSmtpConfigDto.builder()
            .host("localhost")
            .username("")
            .passwordExists(false)
            .fromEmailAddress("")
            .fromDisplayName("From Example")
            .version("1234")
            .testEmailRecipient("to@example.org")
            .build();
    // when
    adminJsonService.sendTestEmail(configDto);
    // then
    Message message = mailService.getMessage();
    String localHostname = InetAddress.getLocalHost().getHostName();
    assertThat(message.getFrom()[0].toString())
            .isEqualTo("From Example <glowroot@" + localHostname + ">");
    assertThat(message.getRecipients(Message.RecipientType.TO)[0].toString())
            .isEqualTo("to@example.org");
    assertThat(message.getSubject()).isEqualTo("[Glowroot] Test email");
    assertThat(message.getContent()).isEqualTo("");
}