Search in sources :

Example 11 with NotificationTO

use of org.apache.syncope.common.lib.to.NotificationTO in project syncope by apache.

the class NotificationITCase method read.

@Test
public void read() {
    NotificationTO notificationTO = notificationService.read("9e2b911c-25de-4c77-bcea-b86ed9451050");
    assertNotNull(notificationTO);
}
Also used : NotificationTO(org.apache.syncope.common.lib.to.NotificationTO) Test(org.junit.jupiter.api.Test)

Example 12 with NotificationTO

use of org.apache.syncope.common.lib.to.NotificationTO in project syncope by apache.

the class NotificationITCase method create.

@Test
public void create() {
    NotificationTO notificationTO = buildNotificationTO();
    notificationTO.setRecipientsFIQL(SyncopeClient.getUserSearchConditionBuilder().inGroups("bf825fe1-7320-4a54-bd64-143b5c18ab97").query());
    Response response = notificationService.create(notificationTO);
    NotificationTO actual = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
    assertNotNull(actual);
    assertNotNull(actual.getKey());
    notificationTO.setKey(actual.getKey());
    assertEquals(actual, notificationTO);
}
Also used : Response(javax.ws.rs.core.Response) NotificationTO(org.apache.syncope.common.lib.to.NotificationTO) Test(org.junit.jupiter.api.Test)

Example 13 with NotificationTO

use of org.apache.syncope.common.lib.to.NotificationTO in project syncope by apache.

the class NotificationITCase method list.

@Test
public void list() {
    List<NotificationTO> notificationTOs = notificationService.list();
    assertNotNull(notificationTOs);
    assertFalse(notificationTOs.isEmpty());
    for (NotificationTO instance : notificationTOs) {
        assertNotNull(instance);
    }
}
Also used : NotificationTO(org.apache.syncope.common.lib.to.NotificationTO) Test(org.junit.jupiter.api.Test)

Example 14 with NotificationTO

use of org.apache.syncope.common.lib.to.NotificationTO in project syncope by apache.

the class NotificationITCase method update.

@Test
public void update() {
    NotificationTO notificationTO = notificationService.read("9e2b911c-25de-4c77-bcea-b86ed9451050");
    notificationTO.setRecipientsFIQL(SyncopeClient.getUserSearchConditionBuilder().inGroups("bf825fe1-7320-4a54-bd64-143b5c18ab97").query());
    notificationService.update(notificationTO);
    NotificationTO actual = notificationService.read(notificationTO.getKey());
    assertNotNull(actual);
    assertEquals(actual, notificationTO);
}
Also used : NotificationTO(org.apache.syncope.common.lib.to.NotificationTO) Test(org.junit.jupiter.api.Test)

Example 15 with NotificationTO

use of org.apache.syncope.common.lib.to.NotificationTO in project syncope by apache.

the class NotificationITCase method issueSYNCOPE446.

@Test
public void issueSYNCOPE446() {
    NotificationTO notificationTO = buildNotificationTO();
    notificationTO.getStaticRecipients().add("syncope446@syncope.apache.org");
    notificationTO.getAbouts().put(AnyTypeKind.GROUP.name(), SyncopeClient.getGroupSearchConditionBuilder().is("name").equalTo("citizen").query());
    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);
}
Also used : Response(javax.ws.rs.core.Response) NotificationTO(org.apache.syncope.common.lib.to.NotificationTO) SyncopeClientException(org.apache.syncope.common.lib.SyncopeClientException) NotificationService(org.apache.syncope.common.rest.api.service.NotificationService) Test(org.junit.jupiter.api.Test)

Aggregations

NotificationTO (org.apache.syncope.common.lib.to.NotificationTO)17 Test (org.junit.jupiter.api.Test)11 Response (javax.ws.rs.core.Response)8 NotificationService (org.apache.syncope.common.rest.api.service.NotificationService)7 SyncopeClientException (org.apache.syncope.common.lib.SyncopeClientException)6 NotificationTaskTO (org.apache.syncope.common.lib.to.NotificationTaskTO)2 Notification (org.apache.syncope.core.persistence.api.entity.Notification)2 URI (java.net.URI)1 ParseException (java.text.ParseException)1 Matcher (java.util.regex.Matcher)1 StringUtils (org.apache.commons.lang3.StringUtils)1 SyncopeConstants (org.apache.syncope.common.lib.SyncopeConstants)1 GroupTO (org.apache.syncope.common.lib.to.GroupTO)1 ImplementationTO (org.apache.syncope.common.lib.to.ImplementationTO)1 MembershipTO (org.apache.syncope.common.lib.to.MembershipTO)1 PushTaskTO (org.apache.syncope.common.lib.to.PushTaskTO)1 UserTO (org.apache.syncope.common.lib.to.UserTO)1 AnyTypeKind (org.apache.syncope.common.lib.types.AnyTypeKind)1 ClientExceptionType (org.apache.syncope.common.lib.types.ClientExceptionType)1 TaskQuery (org.apache.syncope.common.rest.api.beans.TaskQuery)1