use of teammates.logic.core.SendgridService in project teammates by TEAMMATES.
the class EmailSenderTest method testConvertToSendgrid.
@Test
public void testConvertToSendgrid() {
EmailWrapper wrapper = getTypicalEmailWrapper();
Mail email = new SendgridService().parseToEmail(wrapper);
assertEquals(wrapper.getSenderEmail(), email.getFrom().getEmail());
assertEquals(wrapper.getSenderName(), email.getFrom().getName());
assertEquals(wrapper.getRecipient(), email.personalization.get(0).getTos().get(0).getEmail());
assertEquals(wrapper.getBcc(), email.personalization.get(0).getBccs().get(0).getEmail());
assertEquals(wrapper.getReplyTo(), email.getReplyto().getEmail());
assertEquals(wrapper.getSubject(), email.getSubject());
assertEquals("text/plain", email.getContent().get(0).getType());
assertEquals(Jsoup.parse(wrapper.getContent()).text(), email.getContent().get(0).getValue());
assertEquals("text/html", email.getContent().get(1).getType());
assertEquals(wrapper.getContent(), email.getContent().get(1).getValue());
}
Aggregations