use of org.kie.kogito.services.event.impl.UserTaskDeadlineEventBody in project kogito-runtimes by kiegroup.
the class QuarkusMailSenderTest method testMail.
@Test
void testMail() {
UserTaskDeadlineDataEvent event = Mockito.mock(UserTaskDeadlineDataEvent.class);
Map<String, Object> notification = new HashMap<>();
notification.put(MailInfo.SUBJECT_PROPERTY, SUBJECT);
notification.put(MailInfo.BODY_PROPERTY, TEXT);
notification.put(MailInfo.FROM_PROPERTY, "realbetisbalompie@gmail.com");
notification.put(MailInfo.TO_PROPERTY, TO + ",fulanito@doesnotexist.com");
UserTaskDeadlineEventBody eventData = UserTaskDeadlineEventBody.create("1", notification).build();
Mockito.when(event.getData()).thenReturn(eventData);
sender.onDeadline(event);
List<Mail> messages = mailBox.getMessagesSentTo(TO);
assertEquals(1, messages.size());
Mail message = messages.get(0);
assertEquals(TEXT, message.getText());
assertEquals(SUBJECT, message.getSubject());
}
Aggregations