Search in sources :

Example 11 with PullTaskTO

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

the class PullTaskITCase method filteredReconciliation.

@Test
public void filteredReconciliation() throws IOException {
    String user1OnTestPull = UUID.randomUUID().toString();
    String user2OnTestPull = UUID.randomUUID().toString();
    JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
    PullTaskTO task = null;
    UserTO userTO = null;
    try {
        // 1. create 2 users on testpull
        jdbcTemplate.execute("INSERT INTO testpull VALUES (" + "'" + user1OnTestPull + "', 'user1', 'Doe', false, 'mail1@apache.org', NULL)");
        jdbcTemplate.execute("INSERT INTO testpull VALUES (" + "'" + user2OnTestPull + "', 'user2', 'Rossi', false, 'mail2@apache.org', NULL)");
        // 2. create new pull task for test-db, with reconciliation filter (surname 'Rossi')
        ImplementationTO reconFilterBuilder = new ImplementationTO();
        reconFilterBuilder.setKey("TestReconFilterBuilder");
        reconFilterBuilder.setEngine(ImplementationEngine.GROOVY);
        reconFilterBuilder.setType(ImplementationType.RECON_FILTER_BUILDER);
        reconFilterBuilder.setBody(IOUtils.toString(getClass().getResourceAsStream("/TestReconFilterBuilder.groovy"), StandardCharsets.UTF_8));
        Response response = implementationService.create(reconFilterBuilder);
        reconFilterBuilder = implementationService.read(reconFilterBuilder.getType(), response.getHeaderString(RESTHeaders.RESOURCE_KEY));
        assertNotNull(reconFilterBuilder);
        task = taskService.read(TaskType.PULL, "7c2242f4-14af-4ab5-af31-cdae23783655", true);
        task.setPullMode(PullMode.FILTERED_RECONCILIATION);
        task.setReconFilterBuilder(reconFilterBuilder.getKey());
        response = taskService.create(TaskType.PULL, task);
        task = getObject(response.getLocation(), TaskService.class, PullTaskTO.class);
        assertNotNull(task);
        assertEquals(reconFilterBuilder.getKey(), task.getReconFilterBuilder());
        // 3. exec task
        ExecTO execution = execProvisioningTask(taskService, TaskType.PULL, task.getKey(), 50, false);
        assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
        // 4. verify that only enabled user was pulled
        userTO = userService.read("user2");
        assertNotNull(userTO);
        try {
            userService.read("user1");
            fail("This should not happen");
        } catch (SyncopeClientException e) {
            assertEquals(ClientExceptionType.NotFound, e.getType());
        }
    } finally {
        jdbcTemplate.execute("DELETE FROM testpull WHERE id = '" + user1OnTestPull + "'");
        jdbcTemplate.execute("DELETE FROM testpull WHERE id = '" + user2OnTestPull + "'");
        if (task != null && !"7c2242f4-14af-4ab5-af31-cdae23783655".equals(task.getKey())) {
            taskService.delete(TaskType.PULL, task.getKey());
        }
        if (userTO != null) {
            userService.delete(userTO.getKey());
        }
    }
}
Also used : ImplementationTO(org.apache.syncope.common.lib.to.ImplementationTO) Response(javax.ws.rs.core.Response) ExecTO(org.apache.syncope.common.lib.to.ExecTO) UserTO(org.apache.syncope.common.lib.to.UserTO) TaskService(org.apache.syncope.common.rest.api.service.TaskService) PullTaskTO(org.apache.syncope.common.lib.to.PullTaskTO) SyncopeClientException(org.apache.syncope.common.lib.SyncopeClientException) JdbcTemplate(org.springframework.jdbc.core.JdbcTemplate) Test(org.junit.jupiter.api.Test)

Example 12 with PullTaskTO

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

the class PullTaskITCase method remediation.

@Test
public void remediation() {
    // First of all, clear any potential conflict with existing user / group
    ldapCleanup();
    // 1. create ldap cloned resource, where 'userId' (mandatory on Syncope) is removed from mapping
    ResourceTO ldap = resourceService.read(RESOURCE_NAME_LDAP);
    ldap.setKey("ldapForRemediation");
    ProvisionTO provision = ldap.getProvision(AnyTypeKind.USER.name()).get();
    provision.getVirSchemas().clear();
    provision.getMapping().getItems().removeIf(item -> "userId".equals(item.getIntAttrName()));
    ldap = createResource(ldap);
    // 2. create PullTask with remediation enabled, for the new resource
    PullTaskTO pullTask = (PullTaskTO) taskService.search(new TaskQuery.Builder(TaskType.PULL).resource(RESOURCE_NAME_LDAP).build()).getResult().get(0);
    assertNotNull(pullTask);
    pullTask.setResource(ldap.getKey());
    pullTask.setRemediation(true);
    pullTask.getActions().clear();
    Response response = taskService.create(TaskType.PULL, pullTask);
    if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
        throw (RuntimeException) clientFactory.getExceptionMapper().fromResponse(response);
    }
    pullTask = getObject(response.getLocation(), TaskService.class, PullTaskTO.class);
    assertNotNull(pullTask);
    try {
        // 3. execute the pull task and verify that:
        ExecTO execution = execProvisioningTask(taskService, TaskType.PULL, pullTask.getKey(), 50, false);
        assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
        // 3a. user was not pulled
        try {
            userService.read("pullFromLDAP");
            fail("This should never happen");
        } catch (SyncopeClientException e) {
            assertEquals(ClientExceptionType.NotFound, e.getType());
        }
        // 3b. remediation was created
        Optional<RemediationTO> remediation = remediationService.list().stream().filter(r -> "uid=pullFromLDAP,ou=People,o=isp".equalsIgnoreCase(r.getRemoteName())).findFirst();
        assertTrue(remediation.isPresent());
        assertEquals(AnyTypeKind.USER.name(), remediation.get().getAnyType());
        assertEquals(ResourceOperation.CREATE, remediation.get().getOperation());
        assertNotNull(remediation.get().getAnyTOPayload());
        assertNull(remediation.get().getAnyPatchPayload());
        assertNull(remediation.get().getKeyPayload());
        assertTrue(remediation.get().getError().contains("RequiredValuesMissing [userId]"));
        // 4. remedy by copying the email value to userId
        UserTO user = (UserTO) remediation.get().getAnyTOPayload();
        user.getResources().clear();
        String email = user.getPlainAttr("email").get().getValues().get(0);
        user.getPlainAttrs().add(new AttrTO.Builder().schema("userId").value(email).build());
        remediationService.remedy(remediation.get().getKey(), user);
        // 5. user is now found
        user = userService.read("pullFromLDAP");
        assertNotNull(user);
        assertEquals(email, user.getPlainAttr("userId").get().getValues().get(0));
        // 6. remediation was removed
        try {
            remediationService.read(remediation.get().getKey());
            fail("This should never happen");
        } catch (SyncopeClientException e) {
            assertEquals(ClientExceptionType.NotFound, e.getType());
        }
    } finally {
        resourceService.delete(ldap.getKey());
    }
}
Also used : ProvisionTO(org.apache.syncope.common.lib.to.ProvisionTO) SyncopeClientException(org.apache.syncope.common.lib.SyncopeClientException) TaskTO(org.apache.syncope.common.lib.to.TaskTO) Date(java.util.Date) Autowired(org.springframework.beans.factory.annotation.Autowired) UserPatch(org.apache.syncope.common.lib.patch.UserPatch) ProvisioningResult(org.apache.syncope.common.lib.to.ProvisioningResult) ConnObjectTO(org.apache.syncope.common.lib.to.ConnObjectTO) ResourceOperation(org.apache.syncope.common.lib.types.ResourceOperation) ResourceDeassociationAction(org.apache.syncope.common.lib.types.ResourceDeassociationAction) AnyTypeKind(org.apache.syncope.common.lib.types.AnyTypeKind) SpringJUnitConfig(org.springframework.test.context.junit.jupiter.SpringJUnitConfig) LDAPPasswordPullActions(org.apache.syncope.core.provisioning.java.pushpull.LDAPPasswordPullActions) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) Pair(org.apache.commons.lang3.tuple.Pair) BeforeAll(org.junit.jupiter.api.BeforeAll) Locale(java.util.Locale) Map(java.util.Map) RESTHeaders(org.apache.syncope.common.rest.api.RESTHeaders) PagedResult(org.apache.syncope.common.lib.to.PagedResult) FlowableDetector(org.apache.syncope.fit.FlowableDetector) ExecTO(org.apache.syncope.common.lib.to.ExecTO) PullMode(org.apache.syncope.common.lib.types.PullMode) DBPasswordPullActions(org.apache.syncope.core.provisioning.java.pushpull.DBPasswordPullActions) Set(java.util.Set) UUID(java.util.UUID) GroupTO(org.apache.syncope.common.lib.to.GroupTO) StandardCharsets(java.nio.charset.StandardCharsets) ImplementationTO(org.apache.syncope.common.lib.to.ImplementationTO) Test(org.junit.jupiter.api.Test) IOUtils(org.apache.commons.io.IOUtils) ImplementationEngine(org.apache.syncope.common.lib.types.ImplementationEngine) Response(javax.ws.rs.core.Response) DeassociationPatch(org.apache.syncope.common.lib.patch.DeassociationPatch) TestPullActions(org.apache.syncope.fit.core.reference.TestPullActions) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Optional(java.util.Optional) RemediationTO(org.apache.syncope.common.lib.to.RemediationTO) PullPolicyTO(org.apache.syncope.common.lib.policy.PullPolicyTO) Assertions.fail(org.junit.jupiter.api.Assertions.fail) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) TaskService(org.apache.syncope.common.rest.api.service.TaskService) PropagationTaskExecStatus(org.apache.syncope.common.lib.types.PropagationTaskExecStatus) AttrTO(org.apache.syncope.common.lib.to.AttrTO) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) SerializationUtils(org.apache.commons.lang3.SerializationUtils) JdbcTemplate(org.springframework.jdbc.core.JdbcTemplate) HashSet(java.util.HashSet) ConnConfProperty(org.apache.syncope.common.lib.types.ConnConfProperty) DataSource(javax.sql.DataSource) ItemTO(org.apache.syncope.common.lib.to.ItemTO) ImplementationType(org.apache.syncope.common.lib.types.ImplementationType) ClientExceptionType(org.apache.syncope.common.lib.types.ClientExceptionType) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) AnyQuery(org.apache.syncope.common.rest.api.beans.AnyQuery) MembershipTO(org.apache.syncope.common.lib.to.MembershipTO) CipherAlgorithm(org.apache.syncope.common.lib.types.CipherAlgorithm) OutputStream(java.io.OutputStream) SyncopeConstants(org.apache.syncope.common.lib.SyncopeConstants) Properties(java.util.Properties) TaskQuery(org.apache.syncope.common.rest.api.beans.TaskQuery) Encryptor(org.apache.syncope.core.spring.security.Encryptor) ResourceTO(org.apache.syncope.common.lib.to.ResourceTO) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) FileInputStream(java.io.FileInputStream) Name(org.identityconnectors.framework.common.objects.Name) PolicyType(org.apache.syncope.common.lib.types.PolicyType) PasswordPatch(org.apache.syncope.common.lib.patch.PasswordPatch) ConnectorCapability(org.apache.syncope.common.lib.types.ConnectorCapability) PullTaskTO(org.apache.syncope.common.lib.to.PullTaskTO) ConnectorService(org.apache.syncope.common.rest.api.service.ConnectorService) ConnInstanceTO(org.apache.syncope.common.lib.to.ConnInstanceTO) SyncopeClient(org.apache.syncope.client.lib.SyncopeClient) UserTO(org.apache.syncope.common.lib.to.UserTO) InputStream(java.io.InputStream) AnyObjectTO(org.apache.syncope.common.lib.to.AnyObjectTO) TaskType(org.apache.syncope.common.lib.types.TaskType) ExecTO(org.apache.syncope.common.lib.to.ExecTO) TaskService(org.apache.syncope.common.rest.api.service.TaskService) SyncopeClientException(org.apache.syncope.common.lib.SyncopeClientException) RemediationTO(org.apache.syncope.common.lib.to.RemediationTO) Response(javax.ws.rs.core.Response) ResourceTO(org.apache.syncope.common.lib.to.ResourceTO) UserTO(org.apache.syncope.common.lib.to.UserTO) PullTaskTO(org.apache.syncope.common.lib.to.PullTaskTO) ProvisionTO(org.apache.syncope.common.lib.to.ProvisionTO) Test(org.junit.jupiter.api.Test)

Example 13 with PullTaskTO

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

the class PullTaskITCase method issueSYNCOPE1062.

@Test
public void issueSYNCOPE1062() {
    GroupTO propagationGroup = null;
    PullTaskTO pullTask = null;
    UserTO user = null;
    GroupTO group = null;
    try {
        // 1. create group with resource for propagation
        propagationGroup = GroupITCase.getBasicSampleTO("SYNCOPE1062");
        propagationGroup.getResources().add(RESOURCE_NAME_DBPULL);
        propagationGroup = createGroup(propagationGroup).getEntity();
        // 2. create pull task for another resource, with user template assigning the group above
        pullTask = new PullTaskTO();
        pullTask.setDestinationRealm(SyncopeConstants.ROOT_REALM);
        pullTask.setName("SYNCOPE1062");
        pullTask.setActive(true);
        pullTask.setPerformCreate(true);
        pullTask.setPerformUpdate(true);
        pullTask.setPullMode(PullMode.FULL_RECONCILIATION);
        pullTask.setResource(RESOURCE_NAME_LDAP);
        UserTO template = new UserTO();
        template.getAuxClasses().add("minimal group");
        template.getMemberships().add(new MembershipTO.Builder().group(propagationGroup.getKey()).build());
        template.getPlainAttrs().add(attrTO("firstname", "'fixed'"));
        pullTask.getTemplates().put(AnyTypeKind.USER.name(), template);
        Response taskResponse = taskService.create(TaskType.PULL, pullTask);
        pullTask = getObject(taskResponse.getLocation(), TaskService.class, PullTaskTO.class);
        assertNotNull(pullTask);
        assertFalse(pullTask.getTemplates().isEmpty());
        // 3. exec the pull task
        ExecTO execution = execProvisioningTask(taskService, TaskType.PULL, pullTask.getKey(), 50, false);
        assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
        // the user is successfully pulled...
        user = userService.read("pullFromLDAP");
        assertNotNull(user);
        assertEquals("pullFromLDAP@syncope.apache.org", user.getPlainAttr("email").get().getValues().get(0));
        group = groupService.read("testLDAPGroup");
        assertNotNull(group);
        ConnObjectTO connObject = resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), user.getKey());
        assertNotNull(connObject);
        assertEquals("pullFromLDAP@syncope.apache.org", connObject.getAttr("mail").get().getValues().get(0));
        AttrTO userDn = connObject.getAttr(Name.NAME).get();
        assertNotNull(userDn);
        assertEquals(1, userDn.getValues().size());
        assertNotNull(getLdapRemoteObject(RESOURCE_LDAP_ADMIN_DN, RESOURCE_LDAP_ADMIN_PWD, userDn.getValues().get(0)));
        // ...and propagated
        PagedResult<TaskTO> propagationTasks = taskService.search(new TaskQuery.Builder(TaskType.PROPAGATION).resource(RESOURCE_NAME_DBPULL).anyTypeKind(AnyTypeKind.USER).entityKey(user.getKey()).build());
        assertEquals(1, propagationTasks.getSize());
        // 4. update the user on the external resource
        updateLdapRemoteObject(RESOURCE_LDAP_ADMIN_DN, RESOURCE_LDAP_ADMIN_PWD, userDn.getValues().get(0), Pair.of("mail", "pullFromLDAP2@syncope.apache.org"));
        connObject = resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), user.getKey());
        assertNotNull(connObject);
        assertEquals("pullFromLDAP2@syncope.apache.org", connObject.getAttr("mail").get().getValues().get(0));
        // 5. exec the pull task again
        execution = execProvisioningTask(taskService, TaskType.PULL, pullTask.getKey(), 50, false);
        assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
        // the internal is updated...
        user = userService.read("pullFromLDAP");
        assertNotNull(user);
        assertEquals("pullFromLDAP2@syncope.apache.org", user.getPlainAttr("email").get().getValues().get(0));
        // ...and propagated
        propagationTasks = taskService.search(new TaskQuery.Builder(TaskType.PROPAGATION).resource(RESOURCE_NAME_DBPULL).anyTypeKind(AnyTypeKind.USER).entityKey(user.getKey()).build());
        assertEquals(2, propagationTasks.getSize());
    } catch (Exception e) {
        LOG.error("Unexpected during issueSYNCOPE1062()", e);
        fail(e.getMessage());
    } finally {
        if (pullTask != null) {
            taskService.delete(TaskType.PULL, pullTask.getKey());
        }
        if (propagationGroup != null) {
            groupService.delete(propagationGroup.getKey());
        }
        if (group != null) {
            groupService.delete(group.getKey());
        }
        if (user != null) {
            userService.delete(user.getKey());
        }
    }
}
Also used : TaskTO(org.apache.syncope.common.lib.to.TaskTO) PullTaskTO(org.apache.syncope.common.lib.to.PullTaskTO) ExecTO(org.apache.syncope.common.lib.to.ExecTO) TaskService(org.apache.syncope.common.rest.api.service.TaskService) AttrTO(org.apache.syncope.common.lib.to.AttrTO) SyncopeClientException(org.apache.syncope.common.lib.SyncopeClientException) IOException(java.io.IOException) GroupTO(org.apache.syncope.common.lib.to.GroupTO) Response(javax.ws.rs.core.Response) UserTO(org.apache.syncope.common.lib.to.UserTO) TaskQuery(org.apache.syncope.common.rest.api.beans.TaskQuery) MembershipTO(org.apache.syncope.common.lib.to.MembershipTO) PullTaskTO(org.apache.syncope.common.lib.to.PullTaskTO) ConnObjectTO(org.apache.syncope.common.lib.to.ConnObjectTO) Test(org.junit.jupiter.api.Test)

Example 14 with PullTaskTO

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

the class PullTaskITCase method issueSYNCOPE313DB.

@Test
public void issueSYNCOPE313DB() throws Exception {
    // 1. create user in DB
    UserTO user = UserITCase.getUniqueSampleTO("syncope313-db@syncope.apache.org");
    user.setPassword("security123");
    user.getResources().add(RESOURCE_NAME_TESTDB);
    user = createUser(user).getEntity();
    assertNotNull(user);
    assertFalse(user.getResources().isEmpty());
    // 2. Check that the DB resource has the correct password
    JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
    String value = queryForObject(jdbcTemplate, 50, "SELECT PASSWORD FROM test WHERE ID=?", String.class, user.getUsername());
    assertEquals(Encryptor.getInstance().encode("security123", CipherAlgorithm.SHA1), value.toUpperCase());
    // 3. Update the password in the DB
    String newCleanPassword = "new-security";
    String newPassword = Encryptor.getInstance().encode(newCleanPassword, CipherAlgorithm.SHA1);
    jdbcTemplate.execute("UPDATE test set PASSWORD='" + newPassword + "' where ID='" + user.getUsername() + "'");
    // 4. Pull the user from the resource
    ImplementationTO pullActions = new ImplementationTO();
    pullActions.setKey(DBPasswordPullActions.class.getSimpleName());
    pullActions.setEngine(ImplementationEngine.JAVA);
    pullActions.setType(ImplementationType.PULL_ACTIONS);
    pullActions.setBody(DBPasswordPullActions.class.getName());
    Response response = implementationService.create(pullActions);
    pullActions = implementationService.read(pullActions.getType(), response.getHeaderString(RESTHeaders.RESOURCE_KEY));
    assertNotNull(pullActions);
    PullTaskTO pullTask = new PullTaskTO();
    pullTask.setDestinationRealm(SyncopeConstants.ROOT_REALM);
    pullTask.setName("DB Pull Task");
    pullTask.setActive(true);
    pullTask.setPerformCreate(true);
    pullTask.setPerformUpdate(true);
    pullTask.setPullMode(PullMode.FULL_RECONCILIATION);
    pullTask.setResource(RESOURCE_NAME_TESTDB);
    pullTask.getActions().add(pullActions.getKey());
    Response taskResponse = taskService.create(TaskType.PULL, pullTask);
    PullTaskTO actual = getObject(taskResponse.getLocation(), TaskService.class, PullTaskTO.class);
    assertNotNull(actual);
    pullTask = taskService.read(TaskType.PULL, actual.getKey(), true);
    assertNotNull(pullTask);
    assertEquals(actual.getKey(), pullTask.getKey());
    assertEquals(actual.getJobDelegate(), pullTask.getJobDelegate());
    ExecTO execution = execProvisioningTask(taskService, TaskType.PULL, pullTask.getKey(), 50, false);
    assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
    // 5. Test the pulled user
    Pair<Map<String, Set<String>>, UserTO> self = clientFactory.create(user.getUsername(), newCleanPassword).self();
    assertNotNull(self);
    // 6. Delete PullTask + user
    taskService.delete(TaskType.PULL, pullTask.getKey());
    deleteUser(user.getKey());
}
Also used : ImplementationTO(org.apache.syncope.common.lib.to.ImplementationTO) Response(javax.ws.rs.core.Response) ExecTO(org.apache.syncope.common.lib.to.ExecTO) DBPasswordPullActions(org.apache.syncope.core.provisioning.java.pushpull.DBPasswordPullActions) UserTO(org.apache.syncope.common.lib.to.UserTO) PullTaskTO(org.apache.syncope.common.lib.to.PullTaskTO) JdbcTemplate(org.springframework.jdbc.core.JdbcTemplate) Map(java.util.Map) Test(org.junit.jupiter.api.Test)

Example 15 with PullTaskTO

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

the class PullTaskITCase method create.

@Test
public void create() {
    PullTaskTO task = new PullTaskTO();
    task.setName("Test create Pull");
    task.setDestinationRealm("/");
    task.setResource(RESOURCE_NAME_WS2);
    task.setPullMode(PullMode.FULL_RECONCILIATION);
    UserTO userTemplate = new UserTO();
    userTemplate.getResources().add(RESOURCE_NAME_WS2);
    userTemplate.getMemberships().add(new MembershipTO.Builder().group("f779c0d4-633b-4be5-8f57-32eb478a3ca5").build());
    task.getTemplates().put(AnyTypeKind.USER.name(), userTemplate);
    GroupTO groupTemplate = new GroupTO();
    groupTemplate.getResources().add(RESOURCE_NAME_LDAP);
    task.getTemplates().put(AnyTypeKind.GROUP.name(), groupTemplate);
    Response response = taskService.create(TaskType.PULL, task);
    PullTaskTO actual = getObject(response.getLocation(), TaskService.class, PullTaskTO.class);
    assertNotNull(actual);
    task = taskService.read(TaskType.PULL, actual.getKey(), true);
    assertNotNull(task);
    assertEquals(actual.getKey(), task.getKey());
    assertEquals(actual.getJobDelegate(), task.getJobDelegate());
    assertEquals(userTemplate, task.getTemplates().get(AnyTypeKind.USER.name()));
    assertEquals(groupTemplate, task.getTemplates().get(AnyTypeKind.GROUP.name()));
}
Also used : Response(javax.ws.rs.core.Response) UserTO(org.apache.syncope.common.lib.to.UserTO) MembershipTO(org.apache.syncope.common.lib.to.MembershipTO) PullTaskTO(org.apache.syncope.common.lib.to.PullTaskTO) GroupTO(org.apache.syncope.common.lib.to.GroupTO) Test(org.junit.jupiter.api.Test)

Aggregations

PullTaskTO (org.apache.syncope.common.lib.to.PullTaskTO)19 Test (org.junit.jupiter.api.Test)15 Response (javax.ws.rs.core.Response)12 ExecTO (org.apache.syncope.common.lib.to.ExecTO)12 UserTO (org.apache.syncope.common.lib.to.UserTO)12 SyncopeClientException (org.apache.syncope.common.lib.SyncopeClientException)11 ImplementationTO (org.apache.syncope.common.lib.to.ImplementationTO)8 TaskService (org.apache.syncope.common.rest.api.service.TaskService)8 ResourceTO (org.apache.syncope.common.lib.to.ResourceTO)6 JdbcTemplate (org.springframework.jdbc.core.JdbcTemplate)6 GroupTO (org.apache.syncope.common.lib.to.GroupTO)5 MembershipTO (org.apache.syncope.common.lib.to.MembershipTO)5 TaskTO (org.apache.syncope.common.lib.to.TaskTO)5 TaskType (org.apache.syncope.common.lib.types.TaskType)5 Map (java.util.Map)4 UserPatch (org.apache.syncope.common.lib.patch.UserPatch)4 ConnInstanceTO (org.apache.syncope.common.lib.to.ConnInstanceTO)4 ConnObjectTO (org.apache.syncope.common.lib.to.ConnObjectTO)4 ItemTO (org.apache.syncope.common.lib.to.ItemTO)4 ClientExceptionType (org.apache.syncope.common.lib.types.ClientExceptionType)4