use of eu.bcvsolutions.idm.core.notification.api.dto.IdmNotificationDto in project CzechIdMng by bcvsolutions.
the class DefaultNotificationServiceIntegrationTest method parentFilterText.
@Test
public void parentFilterText() {
IdmNotificationFilter filter = new IdmNotificationFilter();
IdmNotificationDto notification = new IdmNotificationDto();
IdmNotificationDto parentNotification = new IdmNotificationDto();
// prepare template and message
IdmNotificationTemplateDto template2 = createTestTemplate("TestTemplate5", "testSubject5");
IdmMessageDto message2 = new IdmMessageDto.Builder().setTemplate(template2).build();
// set parent
parentNotification.setMessage(message2);
IdmNotificationLogDto logDto = notificationManager.send(parentNotification);
notification.setParent(logDto.getMessage().getId());
//
// send message
IdmNotificationTemplateDto template = createTestTemplate("TestTemplate4", "testSubject4");
IdmMessageDto message = new IdmMessageDto.Builder().setTemplate(template).build();
notification.setMessage(message);
notificationManager.send(notification);
// set filter
filter.setParent(logDto.getId());
Page<IdmNotificationLogDto> result = notificationLogService.find(filter, null);
assertEquals("Wrong sender", logDto.getId(), result.getContent().get(0).getParent());
}
use of eu.bcvsolutions.idm.core.notification.api.dto.IdmNotificationDto in project CzechIdMng by bcvsolutions.
the class DefaultNotificationServiceIntegrationTest method senderFilterTest.
@Test
public void senderFilterTest() {
IdmIdentityDto sender = helper.createIdentity();
IdmNotificationFilter filter = new IdmNotificationFilter();
IdmNotificationDto notification = new IdmNotificationDto();
notification.setIdentitySender(sender.getId());
//
// create templates
IdmNotificationTemplateDto template = createTestTemplate("TestTemplate3", "testSubject3");
IdmMessageDto message = new IdmMessageDto.Builder().setTemplate(template).build();
notification.setMessage(message);
notificationManager.send(notification);
//
// filter text BODY
filter.setSender(sender.getUsername());
Page<IdmNotificationLogDto> result = notificationLogService.find(filter, null);
assertEquals("Wrong sender", sender.getId(), result.getContent().get(0).getIdentitySender());
}
use of eu.bcvsolutions.idm.core.notification.api.dto.IdmNotificationDto in project CzechIdMng by bcvsolutions.
the class DefaultNotificationServiceIntegrationTest method testParentFilterText.
@Test
public void testParentFilterText() {
IdmNotificationFilter filter = new IdmNotificationFilter();
IdmNotificationDto notification = new IdmNotificationDto();
IdmNotificationDto parentNotification = new IdmNotificationDto();
// prepare template and message
IdmNotificationTemplateDto template2 = createTestTemplate();
IdmMessageDto message2 = new IdmMessageDto.Builder().setTemplate(template2).build();
// set parent
parentNotification.setMessage(message2);
IdmNotificationLogDto logDto = notificationManager.send(parentNotification);
notification.setParent(logDto.getMessage().getId());
//
// send message
IdmNotificationTemplateDto template = createTestTemplate();
IdmMessageDto message = new IdmMessageDto.Builder().setTemplate(template).build();
notification.setMessage(message);
notificationManager.send(notification);
// set filter
filter.setParent(logDto.getId());
Page<IdmNotificationLogDto> result = notificationLogService.find(filter, null);
assertEquals("Wrong sender", logDto.getId(), result.getContent().get(0).getParent());
}
Aggregations