Assertions for Wiser SMTP test server from subethamail
Paul Campbell
14cc99fd88
Previously the message was written to an output stream. Headers and mime boundaries included. Assertions which use this method are looking at the content of the message, rather than the wrappings. Now we just look at the content of the multiparts. Signed-off-by: Paul Campbell <pcampbell@kemitix.net> |
||
---|---|---|
src/main/java/net/kemitix/wiser/assertions | ||
.gitignore | ||
.travis.yml | ||
checkstyle.xml | ||
LICENSE | ||
nb-configuration.xml | ||
pom.xml | ||
README.md |
wiser-assertions
Assertions for Wiser SMTP test server from subethamail
Origin
Taken from Rafal Browiec WiserAssertions class.
Usage
@Before
public void setUp() throws IOException {
wiser = new Wiser(PORT);
wiser.start();
}
@After
public void tearDown() {
wiser.stop();
}
@Test
public void testMail() {
//given
...
//when
...
//then
WiserAssertions.assertReceivedMessage(wiser)
.from(sender)
.to(recipient_alpha)
.to(recipient_beta)
.withSubjectContains(subject_prefix)
.withSubjectContains(subject_suffix)
.withContentContains(message_element_1)
.withContentContains(message_element_2)
.withContentContains(message_element_3);
}