Issue1Test: add draft test for nested multipart messages
Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
This commit is contained in:
parent
262283d628
commit
986daedfb1
2 changed files with 43 additions and 0 deletions
6
pom.xml
6
pom.xml
|
@ -56,6 +56,12 @@
|
|||
<scope>test</scope>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codemonkey.simplejavamail</groupId>
|
||||
<artifactId>simple-java-mail</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
37
src/test/java/net/kemitix/wiser/assertions/Issue1Test.java
Normal file
37
src/test/java/net/kemitix/wiser/assertions/Issue1Test.java
Normal file
|
@ -0,0 +1,37 @@
|
|||
package net.kemitix.wiser.assertions;
|
||||
|
||||
import org.codemonkey.simplejavamail.Email;
|
||||
import org.codemonkey.simplejavamail.Mailer;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.mail.Message;
|
||||
|
||||
/**
|
||||
* Regression test for issue #1.
|
||||
*
|
||||
* @see https://github.com/kemitix/wiser-assertions/issues/1
|
||||
* @author pcampbell
|
||||
*/
|
||||
public class Issue1Test extends AbstractWiserTest {
|
||||
|
||||
@Test
|
||||
public void shouldParseNestedMultiPartEmails() {
|
||||
//given
|
||||
final Email email = new Email();
|
||||
email.addRecipient("Jonjo McKay", "jonjo.mckay@manywho.com",
|
||||
Message.RecipientType.TO);
|
||||
email.setFromAddress("ManyWho", "no-reply@manywho.com");
|
||||
email.setSubject("New activity");
|
||||
email.setText("Hi Jonjo McKay,\n\nA new message was just posted in a "
|
||||
+ "stream you follow on ManyWho. The message was:\n\nLance "
|
||||
+ "Drake Mandrell: \"This is a test message\"\n\nJoin the flow "
|
||||
+ "at https://flow.manywho.com to read the stream and reply.\n"
|
||||
+ "\nManyWho Email Bot");
|
||||
Mailer mailer = new Mailer(getSession());
|
||||
//when
|
||||
mailer.sendMail(email);
|
||||
//then
|
||||
getAssertions().withContent("Hi Jonjo McKay");
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue