use of org.apache.syncope.common.lib.to.NotificationTO in project syncope by apache.
the class NotificationITCase method issueSYNCOPE974.
@Test
public void issueSYNCOPE974() {
NotificationTO notificationTO = new NotificationTO();
notificationTO.setRecipientAttrName("email");
notificationTO.setSelfAsRecipient(false);
notificationTO.setSender("sender@ukr.net");
notificationTO.setSubject("subject 21");
notificationTO.setTemplate("requestPasswordReset");
notificationTO.setTraceLevel(TraceLevel.ALL);
notificationTO.setActive(true);
try {
notificationService.create(notificationTO);
fail("This should not happen");
} catch (SyncopeClientException e) {
assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
assertTrue(e.getMessage().contains("events"));
}
}
use of org.apache.syncope.common.lib.to.NotificationTO in project syncope by apache.
the class NotificationITCase method issueSYNCOPE83.
@Test
public void issueSYNCOPE83() {
NotificationTO notificationTO = buildNotificationTO();
notificationTO.setSelfAsRecipient(true);
NotificationTO actual = null;
try {
Response response = notificationService.create(notificationTO);
actual = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
} catch (SyncopeClientException e) {
assertNotNull(e);
}
assertNotNull(actual);
assertNotNull(actual.getKey());
notificationTO.setKey(actual.getKey());
assertEquals(actual, notificationTO);
}
use of org.apache.syncope.common.lib.to.NotificationTO in project syncope by apache.
the class NotificationITCase method issueSYNCOPE445.
@Test
public void issueSYNCOPE445() {
NotificationTO notificationTO = buildNotificationTO();
notificationTO.getStaticRecipients().add("syncope445@syncope.apache.org");
NotificationTO actual = null;
try {
Response response = notificationService.create(notificationTO);
actual = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
} catch (SyncopeClientException e) {
assertNotNull(e);
}
assertNotNull(actual);
assertNotNull(actual.getKey());
notificationTO.setKey(actual.getKey());
assertEquals(actual, notificationTO);
}
use of org.apache.syncope.common.lib.to.NotificationTO in project syncope by apache.
the class NotificationITCase method delete.
@Test
public void delete() {
NotificationTO notification = buildNotificationTO();
notification.setSelfAsRecipient(true);
Response response = notificationService.create(notification);
notification = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
notificationService.delete(notification.getKey());
try {
notificationService.read(notification.getKey());
fail("This should not happen");
} catch (SyncopeClientException e) {
assertEquals(ClientExceptionType.NotFound, e.getType());
}
}
use of org.apache.syncope.common.lib.to.NotificationTO in project syncope by apache.
the class NotificationITCase method buildNotificationTO.
private NotificationTO buildNotificationTO() {
NotificationTO notificationTO = new NotificationTO();
notificationTO.setTraceLevel(TraceLevel.SUMMARY);
notificationTO.getEvents().add("create");
notificationTO.getAbouts().put(AnyTypeKind.USER.name(), SyncopeClient.getUserSearchConditionBuilder().is("fullname").equalTo("*o*").and("fullname").equalTo("*i*").query());
notificationTO.setRecipientAttrName("email");
notificationTO.setSender("syncope@syncope.apache.org");
notificationTO.setSubject("Test notification");
notificationTO.setTemplate("test");
return notificationTO;
}
Aggregations