Skip to content

Instantly share code, notes, and snippets.

@mismatch
Created July 12, 2013 18:24
Show Gist options
  • Save mismatch/5986645 to your computer and use it in GitHub Desktop.
Save mismatch/5986645 to your computer and use it in GitHub Desktop.
Wiser vs Dumbster. Test 1
public class EmailerViaWiserTest {
private Wiser wiser;
private Emailer emailer;
@Before
public void setUp() throws Exception {
emailer = new Emailer(config);
wiser = new Wiser(smtpPort);
wiser.start();
}
@After
public void tearDown() throws Exception {
wiser.stop();
}
@Test
public void test() throws MessagingException, IOException {
String subject = "There are new comments";
String body = "Hello, Test!";
emailer.sendEmail("yourhost", "testuser@yandex.ru", subject, body);
List<WiserMessage> messages = wiser.getMessages();
assertEquals(1, messages.size());
MimeMessage mimeMessage = messages.get(0).getMimeMessage();
assertEquals(subject, mimeMessage.getSubject());
assertEquals(body + "\r\n", mimeMessage.getContent().toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment