Search in sources :

Example 1 with IdmNotificationConfigurationFilter

use of eu.bcvsolutions.idm.core.notification.api.dto.filter.IdmNotificationConfigurationFilter in project CzechIdMng by bcvsolutions.

the class IdmNotificationConfigurationFilterTest method testTemplateIdFilter.

@Test
public void testTemplateIdFilter() {
    String text = "someText" + System.currentTimeMillis();
    IdmNotificationTemplateDto templ = createTemplate("template " + System.currentTimeMillis(), "code", "testFilter");
    NotificationConfigurationDto notification = createNotification(NotificationLevel.SUCCESS, CoreModuleDescriptor.MODULE_ID + ":test003", text, templ.getId());
    IdmNotificationConfigurationFilter filter = new IdmNotificationConfigurationFilter();
    filter.setTemplate(templ.getId());
    filter.setNotificationType(text);
    Page<NotificationConfigurationDto> result = idmNotificationConfService.find(filter, null);
    assertEquals(1, result.getTotalElements());
    assertEquals(notification.getId(), result.getContent().get(0).getId());
}
Also used : NotificationConfigurationDto(eu.bcvsolutions.idm.core.notification.api.dto.NotificationConfigurationDto) IdmNotificationConfigurationFilter(eu.bcvsolutions.idm.core.notification.api.dto.filter.IdmNotificationConfigurationFilter) IdmNotificationTemplateDto(eu.bcvsolutions.idm.core.notification.api.dto.IdmNotificationTemplateDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 2 with IdmNotificationConfigurationFilter

use of eu.bcvsolutions.idm.core.notification.api.dto.filter.IdmNotificationConfigurationFilter in project CzechIdMng by bcvsolutions.

the class IdmNotificationConfigurationFilterTest method testLevelFilter.

@Test
public void testLevelFilter() {
    String text = "someText" + System.currentTimeMillis();
    NotificationConfigurationDto notification = createNotification(NotificationLevel.ERROR, CoreModuleDescriptor.MODULE_ID + ":test002", text, null);
    IdmNotificationConfigurationFilter filter = new IdmNotificationConfigurationFilter();
    filter.setLevel(NotificationLevel.ERROR);
    filter.setNotificationType(text);
    Page<NotificationConfigurationDto> result = idmNotificationConfService.find(filter, null);
    assertEquals(1, result.getTotalElements());
    assertEquals(notification.getId(), result.getContent().get(0).getId());
}
Also used : NotificationConfigurationDto(eu.bcvsolutions.idm.core.notification.api.dto.NotificationConfigurationDto) IdmNotificationConfigurationFilter(eu.bcvsolutions.idm.core.notification.api.dto.filter.IdmNotificationConfigurationFilter) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 3 with IdmNotificationConfigurationFilter

use of eu.bcvsolutions.idm.core.notification.api.dto.filter.IdmNotificationConfigurationFilter in project CzechIdMng by bcvsolutions.

the class IdmNotificationConfigurationFilterTest method testNotificationTypeFilter.

@Test
public void testNotificationTypeFilter() {
    String text = "someText" + System.currentTimeMillis();
    NotificationConfigurationDto notification = createNotification(NotificationLevel.SUCCESS, CoreModuleDescriptor.MODULE_ID + ":test004", text, null);
    IdmNotificationConfigurationFilter filter = new IdmNotificationConfigurationFilter();
    filter.setNotificationType(text);
    filter.setText("core:test004");
    Page<NotificationConfigurationDto> result = idmNotificationConfService.find(filter, null);
    assertEquals(1, result.getTotalElements());
    assertEquals(notification.getId(), result.getContent().get(0).getId());
}
Also used : NotificationConfigurationDto(eu.bcvsolutions.idm.core.notification.api.dto.NotificationConfigurationDto) IdmNotificationConfigurationFilter(eu.bcvsolutions.idm.core.notification.api.dto.filter.IdmNotificationConfigurationFilter) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 4 with IdmNotificationConfigurationFilter

use of eu.bcvsolutions.idm.core.notification.api.dto.filter.IdmNotificationConfigurationFilter in project CzechIdMng by bcvsolutions.

the class IdmNotificationConfigurationFilterTest method testTopicFilter.

@Test
public void testTopicFilter() {
    String text = "someText" + System.currentTimeMillis();
    NotificationConfigurationDto notification = createNotification(NotificationLevel.SUCCESS, CoreModuleDescriptor.MODULE_ID + ":test001", text, null);
    IdmNotificationConfigurationFilter filter = new IdmNotificationConfigurationFilter();
    filter.setText("core:test001");
    filter.setNotificationType(text);
    Page<NotificationConfigurationDto> result = idmNotificationConfService.find(filter, null);
    assertEquals(1, result.getTotalElements());
    assertEquals(notification.getId(), result.getContent().get(0).getId());
}
Also used : NotificationConfigurationDto(eu.bcvsolutions.idm.core.notification.api.dto.NotificationConfigurationDto) IdmNotificationConfigurationFilter(eu.bcvsolutions.idm.core.notification.api.dto.filter.IdmNotificationConfigurationFilter) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Aggregations

NotificationConfigurationDto (eu.bcvsolutions.idm.core.notification.api.dto.NotificationConfigurationDto)4 IdmNotificationConfigurationFilter (eu.bcvsolutions.idm.core.notification.api.dto.filter.IdmNotificationConfigurationFilter)4 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)4 Test (org.junit.Test)4 IdmNotificationTemplateDto (eu.bcvsolutions.idm.core.notification.api.dto.IdmNotificationTemplateDto)1