use of org.simplejavamail.api.email.Email in project simple-java-mail by bbottema.
the class EmailPopulatingBuilderImpl1Test method testBuilderBCCAddresses_ComplexFormat.
@Test
public void testBuilderBCCAddresses_ComplexFormat() {
final Email email = builder.bccWithDefaultName("1", "1b <1@candyshop.org>").bcc("5b <5@candyshop.org>").bcc("6@candyshop.org,7b <7@candyshop.org>").bcc("8b <8@candyshop.org>;9@candyshop.org").bcc("10b <10@candyshop.org>;11b <11@candyshop.org>,12@candyshop.org").buildEmail();
assertThat(email.getRecipients()).containsExactlyInAnyOrder(createRecipient("1b", "1@candyshop.org", Message.RecipientType.BCC), createRecipient("5b", "5@candyshop.org", Message.RecipientType.BCC), createRecipient(null, "6@candyshop.org", Message.RecipientType.BCC), createRecipient("7b", "7@candyshop.org", Message.RecipientType.BCC), createRecipient("8b", "8@candyshop.org", Message.RecipientType.BCC), createRecipient(null, "9@candyshop.org", Message.RecipientType.BCC), createRecipient("10b", "10@candyshop.org", Message.RecipientType.BCC), createRecipient("11b", "11@candyshop.org", Message.RecipientType.BCC), createRecipient(null, "12@candyshop.org", Message.RecipientType.BCC));
}
use of org.simplejavamail.api.email.Email in project simple-java-mail by bbottema.
the class EmailPopulatingBuilderImpl1Test method testBuilderToAddresses_ComplexFormat.
@Test
public void testBuilderToAddresses_ComplexFormat() {
final Email email = builder.toWithDefaultName("1", "1b <1@candyshop.org>").to("5b <5@candyshop.org>").to("6@candyshop.org,7b <7@candyshop.org>").to("8b <8@candyshop.org>;9@candyshop.org").to("10b <10@candyshop.org>;11b <11@candyshop.org>,12@candyshop.org").buildEmail();
assertThat(email.getRecipients()).containsExactlyInAnyOrder(createRecipient("1b", "1@candyshop.org", Message.RecipientType.TO), createRecipient("5b", "5@candyshop.org", Message.RecipientType.TO), createRecipient(null, "6@candyshop.org", Message.RecipientType.TO), createRecipient("7b", "7@candyshop.org", Message.RecipientType.TO), createRecipient("8b", "8@candyshop.org", Message.RecipientType.TO), createRecipient(null, "9@candyshop.org", Message.RecipientType.TO), createRecipient("10b", "10@candyshop.org", Message.RecipientType.TO), createRecipient("11b", "11@candyshop.org", Message.RecipientType.TO), createRecipient(null, "12@candyshop.org", Message.RecipientType.TO));
}
use of org.simplejavamail.api.email.Email in project simple-java-mail by bbottema.
the class EmailPopulatingBuilderImpl1Test method testBuilderReturnReceiptToAddressNative.
@Test
public void testBuilderReturnReceiptToAddressNative() throws UnsupportedEncodingException {
final Email email = builder.withReturnReceiptTo(new InternetAddress("lol.pop@somemail.com", "moo")).buildEmail();
assertThat(email.getReturnReceiptTo().getName()).isEqualTo("moo");
assertThat(email.getReturnReceiptTo().getAddress()).isEqualTo("lol.pop@somemail.com");
assertThat(email.getReturnReceiptTo().getType()).isNull();
}
use of org.simplejavamail.api.email.Email in project simple-java-mail by bbottema.
the class EmailPopulatingBuilderImpl1Test method testBuilderReturnReceiptToAddressWithFixedName.
@Test
public void testBuilderReturnReceiptToAddressWithFixedName() {
final Email email = builder.withReturnReceiptTo("lollypop", "lol.pop@somemail.com").buildEmail();
assertThat(email.getReturnReceiptTo().getName()).isEqualTo("lollypop");
assertThat(email.getReturnReceiptTo().getAddress()).isEqualTo("lol.pop@somemail.com");
assertThat(email.getReturnReceiptTo().getType()).isNull();
}
use of org.simplejavamail.api.email.Email in project simple-java-mail by bbottema.
the class EmailPopulatingBuilderImpl1Test method testPrependTextHTML_ToEmptyText.
@Test
public void testPrependTextHTML_ToEmptyText() {
Email test = builder.prependTextHTML("test").buildEmail();
EmailAssert.assertThat(test).hasHTMLText("test");
}
Aggregations