assertTrue(server.getMessages().size() == 0);
}
@Test
public void testSendMessage() throws MessagingException {
Wiser server = new Wiser(2500);
server.start();
Properties props = new Properties();
props.setProperty("mail.enabled", "true");
props.setProperty("mail.host", "localhost");
props.setProperty("mail.port", "2500");
props.setProperty("mail.sender.username", "crohr");
props.setProperty("mail.from.address", "crohr");
props.setProperty("mail.sender.password", "password");
props.setProperty("mail.recipients", "crohr@nearinfinity.com|bmarcur@nearinfinity.com");
Mailer mailer = new Mailer(props);
mailer.sendMessage("Test Message Subject", "Test Message Body");
server.stop();
assertTrue(server.getMessages().size() == 2);
assertEquals("Test Message Subject", server.getMessages().get(0).getMimeMessage().getSubject());
}