Created
July 12, 2013 18:24
-
-
Save mismatch/5986645 to your computer and use it in GitHub Desktop.
Wiser vs Dumbster. Test 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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