syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [02/29] syncope git commit: [SYNCOPE-666] Initial commit, Travis CI builds disabled
Date Mon, 25 May 2015 14:50:38 GMT
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PlainSchemaITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PlainSchemaITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PlainSchemaITCase.java
index 5f317ed..e77f343 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PlainSchemaITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PlainSchemaITCase.java
@@ -29,14 +29,13 @@ import java.security.AccessControlException;
 import java.util.List;
 import javax.ws.rs.core.Response;
 import org.apache.commons.lang3.SerializationUtils;
-import org.apache.syncope.common.lib.AttributableOperations;
+import org.apache.syncope.common.lib.AnyOperations;
 import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.mod.UserMod;
 import org.apache.syncope.common.lib.to.MembershipTO;
 import org.apache.syncope.common.lib.to.PlainSchemaTO;
 import org.apache.syncope.common.lib.to.UserTO;
 import org.apache.syncope.common.lib.types.AttrSchemaType;
-import org.apache.syncope.common.lib.types.AttributableType;
 import org.apache.syncope.common.lib.types.CipherAlgorithm;
 import org.apache.syncope.common.lib.types.ClientExceptionType;
 import org.apache.syncope.common.lib.types.EntityViolationType;
@@ -61,10 +60,10 @@ public class PlainSchemaITCase extends AbstractITCase {
         PlainSchemaTO schemaTO = buildPlainSchemaTO("testAttribute", AttrSchemaType.String);
         schemaTO.setMandatoryCondition("false");
 
-        PlainSchemaTO newPlainSchemaTO = createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+        PlainSchemaTO newPlainSchemaTO = createSchema(SchemaType.PLAIN, schemaTO);
         assertEquals(schemaTO, newPlainSchemaTO);
 
-        newPlainSchemaTO = createSchema(AttributableType.MEMBERSHIP, SchemaType.PLAIN, schemaTO);
+        newPlainSchemaTO = createSchema(SchemaType.PLAIN, schemaTO);
         assertEquals(schemaTO, newPlainSchemaTO);
     }
 
@@ -75,7 +74,7 @@ public class PlainSchemaITCase extends AbstractITCase {
         schemaTO.setType(AttrSchemaType.String);
 
         try {
-            createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+            createSchema(SchemaType.PLAIN, schemaTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
@@ -92,7 +91,7 @@ public class PlainSchemaITCase extends AbstractITCase {
         schemaTO.setType(AttrSchemaType.Enum);
 
         try {
-            createSchema(AttributableType.GROUP, SchemaType.PLAIN, schemaTO);
+            createSchema(SchemaType.PLAIN, schemaTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
@@ -109,7 +108,7 @@ public class PlainSchemaITCase extends AbstractITCase {
         schemaTO.setType(AttrSchemaType.Enum);
 
         try {
-            createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+            createSchema(SchemaType.PLAIN, schemaTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
@@ -126,7 +125,7 @@ public class PlainSchemaITCase extends AbstractITCase {
         schemaTO.setCipherAlgorithm(CipherAlgorithm.AES);
         schemaTO.setSecretKey("huhadfhsjfsfsdkj!####");
 
-        createSchema(AttributableType.MEMBERSHIP, SchemaType.PLAIN, schemaTO);
+        createSchema(SchemaType.PLAIN, schemaTO);
     }
 
     @Test
@@ -136,19 +135,19 @@ public class PlainSchemaITCase extends AbstractITCase {
         schemaTO.setType(AttrSchemaType.Binary);
         schemaTO.setMimeType("application/x-x509-ca-cert");
 
-        createSchema(AttributableType.GROUP, SchemaType.PLAIN, schemaTO);
+        createSchema(SchemaType.PLAIN, schemaTO);
     }
 
     @Test
     public void delete() {
         PlainSchemaTO schemaTO = buildPlainSchemaTO("todelete", AttrSchemaType.String);
         schemaTO.setMandatoryCondition("false");
-        createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+        createSchema(SchemaType.PLAIN, schemaTO);
 
-        schemaService.delete(AttributableType.USER, SchemaType.PLAIN, schemaTO.getKey());
+        schemaService.delete(SchemaType.PLAIN, schemaTO.getKey());
         PlainSchemaTO firstname = null;
         try {
-            firstname = schemaService.read(AttributableType.USER, SchemaType.PLAIN, schemaTO.getKey());
+            firstname = schemaService.read(SchemaType.PLAIN, schemaTO.getKey());
         } catch (SyncopeClientException e) {
             assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
         }
@@ -157,19 +156,19 @@ public class PlainSchemaITCase extends AbstractITCase {
 
     @Test
     public void list() {
-        List<PlainSchemaTO> userSchemas = schemaService.list(AttributableType.USER, SchemaType.PLAIN);
+        List<PlainSchemaTO> userSchemas = schemaService.list(SchemaType.PLAIN);
         assertFalse(userSchemas.isEmpty());
         for (PlainSchemaTO schemaTO : userSchemas) {
             assertNotNull(schemaTO);
         }
 
-        List<PlainSchemaTO> groupSchemas = schemaService.list(AttributableType.GROUP, SchemaType.PLAIN);
+        List<PlainSchemaTO> groupSchemas = schemaService.list(SchemaType.PLAIN);
         assertFalse(groupSchemas.isEmpty());
         for (PlainSchemaTO schemaTO : groupSchemas) {
             assertNotNull(schemaTO);
         }
 
-        List<PlainSchemaTO> membershipSchemas = schemaService.list(AttributableType.MEMBERSHIP, SchemaType.PLAIN);
+        List<PlainSchemaTO> membershipSchemas = schemaService.list(SchemaType.PLAIN);
         assertFalse(membershipSchemas.isEmpty());
         for (PlainSchemaTO schemaTO : membershipSchemas) {
             assertNotNull(schemaTO);
@@ -178,16 +177,16 @@ public class PlainSchemaITCase extends AbstractITCase {
 
     @Test
     public void update() {
-        PlainSchemaTO schemaTO = schemaService.read(AttributableType.GROUP, SchemaType.PLAIN, "icon");
+        PlainSchemaTO schemaTO = schemaService.read(SchemaType.PLAIN, "icon");
         assertNotNull(schemaTO);
 
-        schemaService.update(AttributableType.GROUP, SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
-        PlainSchemaTO updatedTO = schemaService.read(AttributableType.GROUP, SchemaType.PLAIN, "icon");
+        schemaService.update(SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
+        PlainSchemaTO updatedTO = schemaService.read(SchemaType.PLAIN, "icon");
         assertEquals(schemaTO, updatedTO);
 
         updatedTO.setType(AttrSchemaType.Date);
         try {
-            schemaService.update(AttributableType.GROUP, SchemaType.PLAIN, schemaTO.getKey(), updatedTO);
+            schemaService.update(SchemaType.PLAIN, schemaTO.getKey(), updatedTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
@@ -200,7 +199,7 @@ public class PlainSchemaITCase extends AbstractITCase {
         schemaTO.setKey("schema_issue258");
         schemaTO.setType(AttrSchemaType.Double);
 
-        schemaTO = createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+        schemaTO = createSchema(SchemaType.PLAIN, schemaTO);
         assertNotNull(schemaTO);
 
         UserTO userTO = UserITCase.getUniqueSampleTO("issue258@syncope.apache.org");
@@ -211,7 +210,7 @@ public class PlainSchemaITCase extends AbstractITCase {
 
         schemaTO.setType(AttrSchemaType.Long);
         try {
-            schemaService.update(AttributableType.USER, SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
+            schemaService.update(SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
@@ -223,7 +222,7 @@ public class PlainSchemaITCase extends AbstractITCase {
         PlainSchemaTO schemaTO = buildPlainSchemaTO("schema_issue259", AttrSchemaType.Double);
         schemaTO.setUniqueConstraint(true);
 
-        schemaTO = createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+        schemaTO = createSchema(SchemaType.PLAIN, schemaTO);
         assertNotNull(schemaTO);
 
         UserTO userTO = UserITCase.getUniqueSampleTO("issue259@syncope.apache.org");
@@ -233,10 +232,10 @@ public class PlainSchemaITCase extends AbstractITCase {
 
         UserTO newUserTO = SerializationUtils.clone(userTO);
         MembershipTO membership = new MembershipTO();
-        membership.setGroupKey(2L);
+        membership.setRightKey(2L);
         newUserTO.getMemberships().add(membership);
 
-        UserMod userMod = AttributableOperations.diff(newUserTO, userTO);
+        UserMod userMod = AnyOperations.diff(newUserTO, userTO);
 
         userTO = userService.update(userMod.getKey(), userMod).readEntity(UserTO.class);
         assertNotNull(userTO);
@@ -247,7 +246,7 @@ public class PlainSchemaITCase extends AbstractITCase {
         PlainSchemaTO schemaTO = buildPlainSchemaTO("schema_issue260", AttrSchemaType.Double);
         schemaTO.setUniqueConstraint(true);
 
-        schemaTO = createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+        schemaTO = createSchema(SchemaType.PLAIN, schemaTO);
         assertNotNull(schemaTO);
 
         UserTO userTO = UserITCase.getUniqueSampleTO("issue260@syncope.apache.org");
@@ -257,7 +256,7 @@ public class PlainSchemaITCase extends AbstractITCase {
 
         schemaTO.setUniqueConstraint(false);
         try {
-            schemaService.update(AttributableType.USER, SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
+            schemaService.update(SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
             fail("This should not be reacheable");
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
@@ -266,11 +265,11 @@ public class PlainSchemaITCase extends AbstractITCase {
 
     @Test
     public void issueSYNCOPE323() {
-        PlainSchemaTO actual = schemaService.read(AttributableType.GROUP, SchemaType.PLAIN, "icon");
+        PlainSchemaTO actual = schemaService.read(SchemaType.PLAIN, "icon");
         assertNotNull(actual);
 
         try {
-            createSchema(AttributableType.GROUP, SchemaType.PLAIN, actual);
+            createSchema(SchemaType.PLAIN, actual);
             fail();
         } catch (SyncopeClientException e) {
             assertEquals(Response.Status.CONFLICT, e.getType().getResponseStatus());
@@ -279,7 +278,7 @@ public class PlainSchemaITCase extends AbstractITCase {
 
         actual.setKey(null);
         try {
-            createSchema(AttributableType.GROUP, SchemaType.PLAIN, actual);
+            createSchema(SchemaType.PLAIN, actual);
             fail();
         } catch (SyncopeClientException e) {
             assertEquals(Response.Status.BAD_REQUEST, e.getType().getResponseStatus());
@@ -293,7 +292,7 @@ public class PlainSchemaITCase extends AbstractITCase {
                 AttrSchemaType.Double);
 
         try {
-            createSchema(AttributableType.GROUP, SchemaType.PLAIN, schema);
+            createSchema(SchemaType.PLAIN, schema);
             fail();
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
@@ -305,13 +304,13 @@ public class PlainSchemaITCase extends AbstractITCase {
     public void anonymous() {
         SchemaService unauthenticated = clientFactory.createAnonymous().getService(SchemaService.class);
         try {
-            unauthenticated.list(AttributableType.USER, SchemaType.VIRTUAL);
+            unauthenticated.list(SchemaType.VIRTUAL);
             fail();
         } catch (AccessControlException e) {
             assertNotNull(e);
         }
 
         SchemaService anonymous = clientFactory.create(ANONYMOUS_UNAME, ANONYMOUS_KEY).getService(SchemaService.class);
-        assertFalse(anonymous.list(AttributableType.USER, SchemaType.VIRTUAL).isEmpty());
+        assertFalse(anonymous.list(SchemaType.VIRTUAL).isEmpty());
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PolicyITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PolicyITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PolicyITCase.java
index 2e526af..df36ac4 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PolicyITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PolicyITCase.java
@@ -31,10 +31,12 @@ import org.apache.syncope.common.lib.to.AccountPolicyTO;
 import org.apache.syncope.common.lib.to.PasswordPolicyTO;
 import org.apache.syncope.common.lib.to.SyncPolicyTO;
 import org.apache.syncope.common.lib.types.AccountPolicySpec;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.ClientExceptionType;
 import org.apache.syncope.common.lib.types.PasswordPolicySpec;
 import org.apache.syncope.common.lib.types.PolicyType;
 import org.apache.syncope.common.lib.types.SyncPolicySpec;
+import org.apache.syncope.common.lib.types.SyncPolicySpecItem;
 import org.junit.FixMethodOrder;
 import org.junit.Test;
 import org.junit.runners.MethodSorters;
@@ -45,8 +47,12 @@ public class PolicyITCase extends AbstractITCase {
     private SyncPolicyTO buildSyncPolicyTO() {
         SyncPolicyTO policy = new SyncPolicyTO();
 
+        SyncPolicySpecItem item = new SyncPolicySpecItem();
+        item.setAnyTypeKey(AnyTypeKind.USER.name());
+        item.setJavaRule(TestSyncRule.class.getName());
+
         SyncPolicySpec spec = new SyncPolicySpec();
-        spec.setUserJavaRule(TestSyncRule.class.getName());
+        spec.getItems().add(item);
 
         policy.setSpecification(spec);
         policy.setDescription("Sync policy");
@@ -109,7 +115,8 @@ public class PolicyITCase extends AbstractITCase {
 
         assertNotNull(policyTO);
         assertEquals(PolicyType.SYNC, policyTO.getType());
-        assertEquals(TestSyncRule.class.getName(), policyTO.getSpecification().getUserJavaRule());
+        assertEquals(TestSyncRule.class.getName(),
+                policyTO.getSpecification().getItem(AnyTypeKind.USER.name()).getJavaRule());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PushTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PushTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PushTaskITCase.java
index 33ee57a..ef525d5 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PushTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PushTaskITCase.java
@@ -40,21 +40,22 @@ import org.apache.syncope.common.lib.to.PlainSchemaTO;
 import org.apache.syncope.common.lib.to.PushTaskTO;
 import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.syncope.common.lib.to.GroupTO;
+import org.apache.syncope.common.lib.to.ProvisionTO;
 import org.apache.syncope.common.lib.to.TaskExecTO;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.AttrSchemaType;
-import org.apache.syncope.common.lib.types.AttributableType;
 import org.apache.syncope.common.lib.types.IntMappingType;
 import org.apache.syncope.common.lib.types.MappingPurpose;
 import org.apache.syncope.common.lib.types.MatchingRule;
 import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
 import org.apache.syncope.common.lib.types.SchemaType;
-import org.apache.syncope.common.lib.types.SubjectType;
 import org.apache.syncope.common.lib.types.TaskType;
 import org.apache.syncope.common.lib.types.TraceLevel;
 import org.apache.syncope.common.lib.types.UnmatchingRule;
 import org.apache.syncope.common.rest.api.service.NotificationService;
 import org.apache.syncope.common.rest.api.service.ResourceService;
 import org.apache.syncope.common.rest.api.service.TaskService;
+import org.identityconnectors.framework.common.objects.ObjectClass;
 import org.junit.FixMethodOrder;
 import org.junit.Test;
 import org.junit.runners.MethodSorters;
@@ -93,9 +94,9 @@ public class PushTaskITCase extends AbstractTaskITCase {
         PushTaskTO task = new PushTaskTO();
         task.setName("Test create Push");
         task.setResource(RESOURCE_NAME_WS2);
-        task.setUserFilter(
+        task.getFilters().put(AnyTypeKind.USER.name(),
                 SyncopeClient.getUserSearchConditionBuilder().hasNotResources(RESOURCE_NAME_TESTDB2).query());
-        task.setGroupFilter(
+        task.getFilters().put(AnyTypeKind.GROUP.name(),
                 SyncopeClient.getGroupSearchConditionBuilder().isNotNull("cool").query());
         task.setMatchingRule(MatchingRule.LINK);
 
@@ -107,8 +108,10 @@ public class PushTaskITCase extends AbstractTaskITCase {
         assertNotNull(task);
         assertEquals(task.getKey(), actual.getKey());
         assertEquals(task.getJobClassName(), actual.getJobClassName());
-        assertEquals(task.getUserFilter(), actual.getUserFilter());
-        assertEquals(task.getGroupFilter(), actual.getGroupFilter());
+        assertEquals(task.getFilters().get(AnyTypeKind.USER.name()),
+                actual.getFilters().get(AnyTypeKind.USER.name()));
+        assertEquals(task.getFilters().get(AnyTypeKind.GROUP.name()),
+                actual.getFilters().get(AnyTypeKind.GROUP.name()));
         assertEquals(UnmatchingRule.ASSIGN, actual.getUnmatchingRule());
         assertEquals(MatchingRule.LINK, actual.getMatchingRule());
     }
@@ -119,12 +122,12 @@ public class PushTaskITCase extends AbstractTaskITCase {
 
         execSyncTask(23L, 50, false);
 
-        assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.GROUP, 3L));
+        assertNotNull(resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.GROUP.name(), 3L));
         assertTrue(groupService.read(3L).getResources().contains(RESOURCE_NAME_LDAP));
 
         execSyncTask(23L, 50, false);
 
-        assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.GROUP, 3L));
+        assertNotNull(resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.GROUP.name(), 3L));
         assertFalse(groupService.read(3L).getResources().contains(RESOURCE_NAME_LDAP));
     }
 
@@ -249,12 +252,12 @@ public class PushTaskITCase extends AbstractTaskITCase {
     @Test
     public void issueSYNCOPE598() {
         // create a new group schema
-        final PlainSchemaTO schemaTO = new PlainSchemaTO();
+        PlainSchemaTO schemaTO = new PlainSchemaTO();
         schemaTO.setKey("LDAPGroupName" + getUUIDString());
         schemaTO.setType(AttrSchemaType.String);
         schemaTO.setMandatoryCondition("true");
 
-        final PlainSchemaTO newPlainSchemaTO = createSchema(AttributableType.GROUP, SchemaType.PLAIN, schemaTO);
+        PlainSchemaTO newPlainSchemaTO = createSchema(SchemaType.PLAIN, schemaTO);
         assertEquals(schemaTO, newPlainSchemaTO);
 
         // create a new sample group
@@ -262,7 +265,6 @@ public class PushTaskITCase extends AbstractTaskITCase {
         groupTO.setName("all" + getUUIDString());
         groupTO.setRealm("/even");
 
-        groupTO.getGPlainAttrTemplates().add(newPlainSchemaTO.getKey());
         groupTO.getPlainAttrs().add(attrTO(newPlainSchemaTO.getKey(), "all"));
 
         groupTO = createGroup(groupTO);
@@ -277,61 +279,33 @@ public class PushTaskITCase extends AbstractTaskITCase {
             resourceTO.setKey(resourceName);
             resourceTO.setConnectorId(105L);
 
-            final MappingTO umapping = new MappingTO();
-            MappingItemTO item = new MappingItemTO();
-            item.setIntMappingType(IntMappingType.Username);
-            item.setExtAttrName("cn");
-            item.setAccountid(true);
-            item.setPurpose(MappingPurpose.PROPAGATION);
-            item.setMandatoryCondition("true");
-            umapping.setAccountIdItem(item);
-
-            item = new MappingItemTO();
-            item.setIntMappingType(IntMappingType.UserPlainSchema);
-            item.setExtAttrName("surname");
-            item.setIntAttrName("sn");
-            item.setPurpose(MappingPurpose.BOTH);
-            umapping.addItem(item);
-
-            item = new MappingItemTO();
-            item.setIntMappingType(IntMappingType.UserPlainSchema);
-            item.setExtAttrName("email");
-            item.setIntAttrName("mail");
-            item.setPurpose(MappingPurpose.BOTH);
-            umapping.addItem(item);
+            ProvisionTO provisionTO = new ProvisionTO();
+            provisionTO.setAnyType(AnyTypeKind.GROUP.name());
+            provisionTO.setObjectClass(ObjectClass.GROUP_NAME);
+            resourceTO.getProvisions().add(provisionTO);
 
-            item = new MappingItemTO();
-            item.setIntMappingType(IntMappingType.Password);
-            item.setPassword(true);
-            item.setPurpose(MappingPurpose.BOTH);
-            item.setMandatoryCondition("true");
-            umapping.addItem(item);
-
-            umapping.setAccountLink("'cn=' + username + ',ou=people,o=isp'");
-
-            final MappingTO rmapping = new MappingTO();
+            MappingTO rmapping = new MappingTO();
+            provisionTO.setMapping(rmapping);
 
-            item = new MappingItemTO();
+            MappingItemTO item = new MappingItemTO();
             item.setIntMappingType(IntMappingType.GroupPlainSchema);
             item.setExtAttrName("cn");
             item.setIntAttrName(newPlainSchemaTO.getKey());
             item.setAccountid(true);
             item.setPurpose(MappingPurpose.BOTH);
-            rmapping.setAccountIdItem(item);
-
-            rmapping.setAccountLink("'cn=' + " + newPlainSchemaTO.getKey() + " + ',ou=groups,o=isp'");
+            rmapping.setConnObjectKeyItem(item);
 
-            resourceTO.setGmapping(rmapping);
+            rmapping.setConnObjectLink("'cn=' + " + newPlainSchemaTO.getKey() + " + ',ou=groups,o=isp'");
 
             Response response = resourceService.create(resourceTO);
             newResourceTO = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
 
             assertNotNull(newResourceTO);
-            assertNull(newResourceTO.getUmapping());
-            assertNotNull(newResourceTO.getGmapping());
+            assertNull(newResourceTO.getProvision(AnyTypeKind.USER.name()));
+            assertNotNull(newResourceTO.getProvision(AnyTypeKind.GROUP.name()).getMapping());
 
             // create push task ad-hoc
-            final PushTaskTO task = new PushTaskTO();
+            PushTaskTO task = new PushTaskTO();
             task.setName("issueSYNCOPE598");
             task.setResource(resourceName);
             task.setPerformCreate(true);
@@ -341,12 +315,12 @@ public class PushTaskITCase extends AbstractTaskITCase {
             task.setMatchingRule(MatchingRule.UPDATE);
 
             response = taskService.create(task);
-            final PushTaskTO push = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
+            PushTaskTO push = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
 
             assertNotNull(push);
 
             // execute the new task
-            final TaskExecTO pushExec = execSyncTask(push.getKey(), 50, false);
+            TaskExecTO pushExec = execSyncTask(push.getKey(), 50, false);
             assertTrue(PropagationTaskExecStatus.valueOf(pushExec.getStatus()).isSuccessful());
         } finally {
             groupService.delete(groupTO.getKey());
@@ -359,12 +333,12 @@ public class PushTaskITCase extends AbstractTaskITCase {
     @Test
     public void issueSYNCOPE648() {
         //1. Create Push Task
-        final PushTaskTO task = new PushTaskTO();
+        PushTaskTO task = new PushTaskTO();
         task.setName("Test create Push");
         task.setResource(RESOURCE_NAME_LDAP);
-        task.setUserFilter(
+        task.getFilters().put(AnyTypeKind.USER.name(),
                 SyncopeClient.getUserSearchConditionBuilder().is("username").equalTo("_NO_ONE_").query());
-        task.setGroupFilter(
+        task.getFilters().put(AnyTypeKind.GROUP.name(),
                 SyncopeClient.getGroupSearchConditionBuilder().is("name").equalTo("citizen").query());
         task.setMatchingRule(MatchingRule.IGNORE);
         task.setUnmatchingRule(UnmatchingRule.IGNORE);

http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ResourceITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ResourceITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ResourceITCase.java
index 1a014bd..21c3e92 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ResourceITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ResourceITCase.java
@@ -36,7 +36,9 @@ import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.BulkAction;
 import org.apache.syncope.common.lib.to.MappingItemTO;
 import org.apache.syncope.common.lib.to.MappingTO;
+import org.apache.syncope.common.lib.to.ProvisionTO;
 import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.ClientExceptionType;
 import org.apache.syncope.common.lib.types.ConnConfPropSchema;
 import org.apache.syncope.common.lib.types.ConnConfProperty;
@@ -44,6 +46,7 @@ import org.apache.syncope.common.lib.types.EntityViolationType;
 import org.apache.syncope.common.lib.types.IntMappingType;
 import org.apache.syncope.common.lib.types.MappingPurpose;
 import org.apache.syncope.common.rest.api.service.ResourceService;
+import org.identityconnectors.framework.common.objects.ObjectClass;
 import org.junit.FixMethodOrder;
 import org.junit.Test;
 import org.junit.runners.MethodSorters;
@@ -57,21 +60,27 @@ public class ResourceITCase extends AbstractITCase {
         resourceTO.setKey(resourceName);
         resourceTO.setConnectorId(102L);
 
+        ProvisionTO provisionTO = new ProvisionTO();
+        provisionTO.setAnyType(AnyTypeKind.USER.name());
+        provisionTO.setObjectClass(ObjectClass.ACCOUNT_NAME);
+        resourceTO.getProvisions().add(provisionTO);
+
         MappingTO mapping = new MappingTO();
+        provisionTO.setMapping(mapping);
 
         MappingItemTO item = new MappingItemTO();
         item.setExtAttrName("userId");
         item.setIntAttrName("userId");
         item.setIntMappingType(IntMappingType.UserPlainSchema);
         item.setPurpose(MappingPurpose.BOTH);
-        mapping.addItem(item);
+        mapping.add(item);
 
         item = new MappingItemTO();
         item.setExtAttrName("username");
         item.setIntAttrName("fullname");
         item.setIntMappingType(IntMappingType.UserId);
         item.setPurpose(MappingPurpose.BOTH);
-        mapping.setAccountIdItem(item);
+        mapping.setConnObjectKeyItem(item);
 
         item = new MappingItemTO();
         item.setExtAttrName("fullname");
@@ -79,9 +88,8 @@ public class ResourceITCase extends AbstractITCase {
         item.setIntMappingType(IntMappingType.UserPlainSchema);
         item.setAccountid(false);
         item.setPurpose(MappingPurpose.BOTH);
-        mapping.addItem(item);
+        mapping.add(item);
 
-        resourceTO.setUmapping(mapping);
         return resourceTO;
     }
 
@@ -111,14 +119,20 @@ public class ResourceITCase extends AbstractITCase {
         String resourceName = "overriding-conn-conf-target-resource-create";
         ResourceTO resourceTO = new ResourceTO();
 
+        ProvisionTO provisionTO = new ProvisionTO();
+        provisionTO.setAnyType(AnyTypeKind.USER.name());
+        provisionTO.setObjectClass(ObjectClass.ACCOUNT_NAME);
+        resourceTO.getProvisions().add(provisionTO);
+
         MappingTO mapping = new MappingTO();
+        provisionTO.setMapping(mapping);
 
         MappingItemTO item = new MappingItemTO();
         item.setExtAttrName("uid");
         item.setIntAttrName("userId");
         item.setIntMappingType(IntMappingType.UserPlainSchema);
         item.setPurpose(MappingPurpose.BOTH);
-        mapping.addItem(item);
+        mapping.add(item);
 
         item = new MappingItemTO();
         item.setExtAttrName("username");
@@ -126,7 +140,7 @@ public class ResourceITCase extends AbstractITCase {
         item.setIntMappingType(IntMappingType.UserId);
         item.setAccountid(true);
         item.setPurpose(MappingPurpose.BOTH);
-        mapping.setAccountIdItem(item);
+        mapping.setConnObjectKeyItem(item);
 
         item = new MappingItemTO();
         item.setExtAttrName("fullname");
@@ -134,13 +148,11 @@ public class ResourceITCase extends AbstractITCase {
         item.setIntMappingType(IntMappingType.UserPlainSchema);
         item.setAccountid(false);
         item.setPurpose(MappingPurpose.BOTH);
-        mapping.addItem(item);
+        mapping.add(item);
 
         resourceTO.setKey(resourceName);
         resourceTO.setConnectorId(102L);
 
-        resourceTO.setUmapping(mapping);
-
         ConnConfProperty p = new ConnConfProperty();
         ConnConfPropSchema schema = new ConnConfPropSchema();
         schema.setType("java.lang.String");
@@ -149,7 +161,7 @@ public class ResourceITCase extends AbstractITCase {
         p.setSchema(schema);
         p.getValues().add("http://invalidurl/");
 
-        Set<ConnConfProperty> connectorConfigurationProperties = new HashSet<ConnConfProperty>(Arrays.asList(p));
+        Set<ConnConfProperty> connectorConfigurationProperties = new HashSet<>(Arrays.asList(p));
         resourceTO.getConnConfProperties().addAll(connectorConfigurationProperties);
 
         Response response = resourceService.create(resourceTO);
@@ -168,38 +180,47 @@ public class ResourceITCase extends AbstractITCase {
         resourceTO.setKey(resourceName);
         resourceTO.setConnectorId(102L);
 
-        MappingTO umapping = new MappingTO();
+        ProvisionTO provisionTO = new ProvisionTO();
+        provisionTO.setAnyType(AnyTypeKind.USER.name());
+        provisionTO.setObjectClass(ObjectClass.ACCOUNT_NAME);
+        resourceTO.getProvisions().add(provisionTO);
+
+        MappingTO mapping = new MappingTO();
+        provisionTO.setMapping(mapping);
 
         MappingItemTO item = new MappingItemTO();
         item.setIntMappingType(IntMappingType.UserId);
         item.setExtAttrName("userId");
         item.setAccountid(true);
         item.setPurpose(MappingPurpose.PROPAGATION);
-        umapping.setAccountIdItem(item);
-
-        resourceTO.setUmapping(umapping);
+        mapping.setConnObjectKeyItem(item);
 
-        MappingTO rmapping = new MappingTO();
+        provisionTO = new ProvisionTO();
+        provisionTO.setAnyType(AnyTypeKind.GROUP.name());
+        provisionTO.setObjectClass(ObjectClass.GROUP_NAME);
+        resourceTO.getProvisions().add(provisionTO);
 
+        mapping = new MappingTO();
+        provisionTO.setMapping(mapping);
         item = new MappingItemTO();
         item.setIntMappingType(IntMappingType.GroupId);
         item.setExtAttrName("groupId");
         item.setAccountid(true);
         item.setPurpose(MappingPurpose.SYNCHRONIZATION);
-        rmapping.setAccountIdItem(item);
-
-        resourceTO.setGmapping(rmapping);
+        mapping.setConnObjectKeyItem(item);
 
         Response response = resourceService.create(resourceTO);
         ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
 
         assertNotNull(actual);
-        assertNotNull(actual.getUmapping());
-        assertNotNull(actual.getUmapping().getItems());
-        assertNotNull(actual.getGmapping());
-        assertNotNull(actual.getGmapping().getItems());
-        assertEquals(MappingPurpose.SYNCHRONIZATION, actual.getGmapping().getAccountIdItem().getPurpose());
-        assertEquals(MappingPurpose.PROPAGATION, actual.getUmapping().getAccountIdItem().getPurpose());
+        assertNotNull(actual.getProvision(AnyTypeKind.USER.name()).getMapping());
+        assertNotNull(actual.getProvision(AnyTypeKind.USER.name()).getMapping().getItems());
+        assertNotNull(actual.getProvision(AnyTypeKind.GROUP.name()).getMapping());
+        assertNotNull(actual.getProvision(AnyTypeKind.GROUP.name()).getMapping().getItems());
+        assertEquals(MappingPurpose.SYNCHRONIZATION,
+                actual.getProvision(AnyTypeKind.GROUP.name()).getMapping().getConnObjectKeyItem().getPurpose());
+        assertEquals(MappingPurpose.PROPAGATION,
+                actual.getProvision(AnyTypeKind.USER.name()).getMapping().getConnObjectKeyItem().getPurpose());
     }
 
     @Test
@@ -209,21 +230,25 @@ public class ResourceITCase extends AbstractITCase {
         resourceTO.setKey(resourceName);
         resourceTO.setConnectorId(102L);
 
+        ProvisionTO provisionTO = new ProvisionTO();
+        provisionTO.setAnyType(AnyTypeKind.USER.name());
+        provisionTO.setObjectClass(ObjectClass.ACCOUNT_NAME);
+        resourceTO.getProvisions().add(provisionTO);
+
         MappingTO mapping = new MappingTO();
+        provisionTO.setMapping(mapping);
 
         MappingItemTO item = new MappingItemTO();
         item.setIntMappingType(IntMappingType.UserId);
         item.setExtAttrName("userId");
         item.setAccountid(true);
-        mapping.setAccountIdItem(item);
+        mapping.setConnObjectKeyItem(item);
 
         item = new MappingItemTO();
         item.setIntMappingType(IntMappingType.UserPlainSchema);
         item.setExtAttrName("email");
         // missing intAttrName ...
-        mapping.addItem(item);
-
-        resourceTO.setUmapping(mapping);
+        mapping.add(item);
 
         try {
             createResource(resourceTO);
@@ -241,21 +266,25 @@ public class ResourceITCase extends AbstractITCase {
         resourceTO.setKey(resourceName);
         resourceTO.setConnectorId(102L);
 
+        ProvisionTO provisionTO = new ProvisionTO();
+        provisionTO.setAnyType(AnyTypeKind.USER.name());
+        provisionTO.setObjectClass(ObjectClass.ACCOUNT_NAME);
+        resourceTO.getProvisions().add(provisionTO);
+
         MappingTO mapping = new MappingTO();
+        provisionTO.setMapping(mapping);
 
         MappingItemTO item = new MappingItemTO();
         item.setIntMappingType(IntMappingType.UserId);
         item.setExtAttrName("userId");
         item.setAccountid(true);
-        mapping.setAccountIdItem(item);
+        mapping.setConnObjectKeyItem(item);
 
         item = new MappingItemTO();
         item.setIntMappingType(IntMappingType.UserPlainSchema);
         item.setIntAttrName("usernane");
         // missing extAttrName ...
-        mapping.addItem(item);
-
-        resourceTO.setUmapping(mapping);
+        mapping.add(item);
 
         createResource(resourceTO);
     }
@@ -268,7 +297,13 @@ public class ResourceITCase extends AbstractITCase {
         resourceTO.setConnectorId(102L);
         resourceTO.setPasswordPolicy(4L);
 
+        ProvisionTO provisionTO = new ProvisionTO();
+        provisionTO.setAnyType(AnyTypeKind.USER.name());
+        provisionTO.setObjectClass(ObjectClass.ACCOUNT_NAME);
+        resourceTO.getProvisions().add(provisionTO);
+
         MappingTO mapping = new MappingTO();
+        provisionTO.setMapping(mapping);
 
         MappingItemTO item = new MappingItemTO();
         item.setExtAttrName("userId");
@@ -276,9 +311,7 @@ public class ResourceITCase extends AbstractITCase {
         item.setIntMappingType(IntMappingType.UserPlainSchema);
         item.setAccountid(true);
         item.setPurpose(MappingPurpose.BOTH);
-        mapping.setAccountIdItem(item);
-
-        resourceTO.setUmapping(mapping);
+        mapping.setConnObjectKeyItem(item);
 
         Response response = resourceService.create(resourceTO);
         ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
@@ -311,7 +344,13 @@ public class ResourceITCase extends AbstractITCase {
         resourceTO.setKey(resourceName);
         resourceTO.setConnectorId(101L);
 
+        ProvisionTO provisionTO = new ProvisionTO();
+        provisionTO.setAnyType(AnyTypeKind.USER.name());
+        provisionTO.setObjectClass(ObjectClass.ACCOUNT_NAME);
+        resourceTO.getProvisions().add(provisionTO);
+
         MappingTO mapping = new MappingTO();
+        provisionTO.setMapping(mapping);
 
         // Update with an existing and already assigned mapping
         MappingItemTO item = new MappingItemTO();
@@ -320,7 +359,7 @@ public class ResourceITCase extends AbstractITCase {
         item.setIntAttrName("fullname");
         item.setIntMappingType(IntMappingType.UserPlainSchema);
         item.setPurpose(MappingPurpose.BOTH);
-        mapping.addItem(item);
+        mapping.add(item);
 
         // Update defining new mappings
         for (int i = 4; i < 6; i++) {
@@ -329,7 +368,7 @@ public class ResourceITCase extends AbstractITCase {
             item.setIntAttrName("fullname");
             item.setIntMappingType(IntMappingType.UserPlainSchema);
             item.setPurpose(MappingPurpose.BOTH);
-            mapping.addItem(item);
+            mapping.add(item);
         }
         item = new MappingItemTO();
         item.setExtAttrName("username");
@@ -337,16 +376,14 @@ public class ResourceITCase extends AbstractITCase {
         item.setIntMappingType(IntMappingType.UserId);
         item.setAccountid(true);
         item.setPurpose(MappingPurpose.BOTH);
-        mapping.setAccountIdItem(item);
-
-        resourceTO.setUmapping(mapping);
+        mapping.setConnObjectKeyItem(item);
 
         resourceService.update(resourceTO.getKey(), resourceTO);
         ResourceTO actual = resourceService.read(resourceTO.getKey());
         assertNotNull(actual);
 
         // check for existence
-        Collection<MappingItemTO> mapItems = actual.getUmapping().getItems();
+        Collection<MappingItemTO> mapItems = actual.getProvision(AnyTypeKind.USER.name()).getMapping().getItems();
         assertNotNull(mapItems);
         assertEquals(4, mapItems.size());
     }
@@ -366,14 +403,15 @@ public class ResourceITCase extends AbstractITCase {
         // create resource with sync token
         String resourceName = RESOURCE_NAME_RESETSYNCTOKEN + getUUIDString();
         ResourceTO pre = buildResourceTO(resourceName);
-        pre.setUsyncToken("test");
+
+        pre.getProvision(AnyTypeKind.USER.name()).setSyncToken("test");
         resourceService.create(pre);
 
-        pre.setUsyncToken(null);
+        pre.getProvision(AnyTypeKind.USER.name()).setSyncToken(null);
         resourceService.update(pre.getKey(), pre);
         ResourceTO actual = resourceService.read(pre.getKey());
         // check that the synctoken has been reset
-        assertNull(actual.getUsyncToken());
+        assertNull(actual.getProvision(AnyTypeKind.USER.name()).getSyncToken());
     }
 
     @Test
@@ -470,14 +508,14 @@ public class ResourceITCase extends AbstractITCase {
 
         ResourceTO resource = resourceService.read(name);
         assertNotNull(resource);
-        assertNotNull(resource.getUmapping());
+        assertNotNull(resource.getProvision(AnyTypeKind.USER.name()).getMapping());
 
-        resource.setUmapping(new MappingTO());
+        resource.getProvision(AnyTypeKind.USER.name()).setMapping(new MappingTO());
         resourceService.update(name, resource);
 
         resource = resourceService.read(name);
         assertNotNull(resource);
-        assertNull(resource.getUmapping());
+        assertNull(resource.getProvision(AnyTypeKind.USER.name()).getMapping());
     }
 
     @Test
@@ -489,25 +527,29 @@ public class ResourceITCase extends AbstractITCase {
         resourceTO.setKey(name);
         resourceTO.setConnectorId(105L);
 
+        ProvisionTO provisionTO = new ProvisionTO();
+        provisionTO.setAnyType(AnyTypeKind.GROUP.name());
+        provisionTO.setObjectClass(ObjectClass.GROUP_NAME);
+        resourceTO.getProvisions().add(provisionTO);
+
         MappingTO mapping = new MappingTO();
+        provisionTO.setMapping(mapping);
 
         MappingItemTO item = new MappingItemTO();
         item.setIntMappingType(IntMappingType.GroupName);
         item.setExtAttrName("cn");
         item.setPurpose(MappingPurpose.BOTH);
-        mapping.setAccountIdItem(item);
+        mapping.setConnObjectKeyItem(item);
 
         item = new MappingItemTO();
         item.setIntMappingType(IntMappingType.GroupOwnerSchema);
         item.setExtAttrName("owner");
         item.setPurpose(MappingPurpose.BOTH);
-        mapping.addItem(item);
-
-        resourceTO.setGmapping(mapping);
+        mapping.add(item);
 
         resourceTO = createResource(resourceTO);
         assertNotNull(resourceTO);
-        assertEquals(2, resourceTO.getGmapping().getItems().size());
+        assertEquals(2, resourceTO.getProvision(AnyTypeKind.GROUP.name()).getMapping().getItems().size());
     }
 
     @Test
@@ -519,7 +561,7 @@ public class ResourceITCase extends AbstractITCase {
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.InvalidExternalResource, e.getType());
 
-            assertTrue(e.getElements().iterator().next().toString().contains(EntityViolationType.InvalidName.name()));
+            assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidName.name()));
         }
     }
 
@@ -546,14 +588,20 @@ public class ResourceITCase extends AbstractITCase {
         resourceTO.setKey(resourceName);
         resourceTO.setConnectorId(102L);
 
-        MappingTO umapping = new MappingTO();
+        ProvisionTO provisionTO = new ProvisionTO();
+        provisionTO.setAnyType(AnyTypeKind.USER.name());
+        provisionTO.setObjectClass(ObjectClass.ACCOUNT_NAME);
+        resourceTO.getProvisions().add(provisionTO);
+
+        MappingTO mapping = new MappingTO();
+        provisionTO.setMapping(mapping);
 
         MappingItemTO item = new MappingItemTO();
         item.setIntMappingType(IntMappingType.UserId);
         item.setExtAttrName("userId");
         item.setAccountid(true);
         item.setPurpose(MappingPurpose.PROPAGATION);
-        umapping.setAccountIdItem(item);
+        mapping.setConnObjectKeyItem(item);
 
         MappingItemTO item2 = new MappingItemTO();
         item2.setIntMappingType(IntMappingType.UserPlainSchema);
@@ -561,18 +609,17 @@ public class ResourceITCase extends AbstractITCase {
         item2.setIntAttrName("gender");
         item2.setExtAttrName("gender");
         item2.setPurpose(MappingPurpose.NONE);
-        umapping.addItem(item2);
-
-        resourceTO.setUmapping(umapping);
+        mapping.add(item2);
 
         Response response = resourceService.create(resourceTO);
         ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
 
         assertNotNull(actual);
-        assertNotNull(actual.getUmapping());
-        assertNotNull(actual.getUmapping().getItems());
-        assertEquals(MappingPurpose.PROPAGATION, actual.getUmapping().getAccountIdItem().getPurpose());
-        for (MappingItemTO itemTO : actual.getUmapping().getItems()) {
+        assertNotNull(actual.getProvision(AnyTypeKind.USER.name()).getMapping());
+        assertNotNull(actual.getProvision(AnyTypeKind.USER.name()).getMapping().getItems());
+        assertEquals(MappingPurpose.PROPAGATION,
+                actual.getProvision(AnyTypeKind.USER.name()).getMapping().getConnObjectKeyItem().getPurpose());
+        for (MappingItemTO itemTO : actual.getProvision(AnyTypeKind.USER.name()).getMapping().getItems()) {
             if ("gender".equals(itemTO.getIntAttrName())) {
                 assertEquals(MappingPurpose.NONE, itemTO.getPurpose());
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SearchITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SearchITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SearchITCase.java
index 0f56510..02ccb5e 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SearchITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SearchITCase.java
@@ -18,7 +18,6 @@
  */
 package org.apache.syncope.fit.core.reference;
 
-import static org.apache.syncope.fit.core.reference.AbstractITCase.userService;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -29,7 +28,6 @@ import javax.ws.rs.core.Response;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.client.lib.SyncopeClient;
-import org.apache.syncope.common.lib.CollectionUtils2;
 import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.PagedResult;
 import org.apache.syncope.common.lib.to.GroupTO;
@@ -64,7 +62,7 @@ public class SearchITCase extends AbstractITCase {
         assertNotNull(matchedUsers);
         assertFalse(matchedUsers.getResult().isEmpty());
 
-        Collection<UserTO> found = CollectionUtils2.find(matchedUsers.getResult(), new Predicate<UserTO>() {
+        Collection<UserTO> found = CollectionUtils.select(matchedUsers.getResult(), new Predicate<UserTO>() {
 
             @Override
             public boolean evaluate(final UserTO user) {
@@ -119,7 +117,7 @@ public class SearchITCase extends AbstractITCase {
     @Test
     public void searchByDynGroup() {
         GroupTO group = GroupITCase.getBasicSampleTO("dynMembership");
-        group.setDynMembershipCond("cool==true");
+        group.setUDynMembershipCond("cool==true");
         group = createGroup(group);
         assertNotNull(group);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SyncTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SyncTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SyncTaskITCase.java
index 27353f0..868deee 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SyncTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SyncTaskITCase.java
@@ -48,11 +48,12 @@ import org.apache.syncope.common.lib.to.SyncPolicyTO;
 import org.apache.syncope.common.lib.to.SyncTaskTO;
 import org.apache.syncope.common.lib.to.TaskExecTO;
 import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.CipherAlgorithm;
 import org.apache.syncope.common.lib.types.ConnConfProperty;
 import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
 import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
-import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.syncope.common.lib.types.SyncPolicySpecItem;
 import org.apache.syncope.common.lib.types.TaskType;
 import org.apache.syncope.common.lib.wrap.ResourceName;
 import org.apache.syncope.common.rest.api.CollectionWrapper;
@@ -108,13 +109,13 @@ public class SyncTaskITCase extends AbstractTaskITCase {
         userTemplate.getResources().add(RESOURCE_NAME_WS2);
 
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(8L);
+        membershipTO.setRightKey(8L);
         userTemplate.getMemberships().add(membershipTO);
-        task.setUserTemplate(userTemplate);
+        task.getTemplates().put(AnyTypeKind.USER.name(), userTemplate);
 
         GroupTO groupTemplate = new GroupTO();
         groupTemplate.getResources().add(RESOURCE_NAME_LDAP);
-        task.setGroupTemplate(groupTemplate);
+        task.getTemplates().put(AnyTypeKind.GROUP.name(), groupTemplate);
 
         Response response = taskService.create(task);
         SyncTaskTO actual = getObject(response.getLocation(), TaskService.class, SyncTaskTO.class);
@@ -124,8 +125,8 @@ public class SyncTaskITCase extends AbstractTaskITCase {
         assertNotNull(task);
         assertEquals(actual.getKey(), task.getKey());
         assertEquals(actual.getJobClassName(), task.getJobClassName());
-        assertEquals(userTemplate, task.getUserTemplate());
-        assertEquals(groupTemplate, task.getGroupTemplate());
+        assertEquals(userTemplate, task.getTemplates().get(AnyTypeKind.USER.name()));
+        assertEquals(groupTemplate, task.getTemplates().get(AnyTypeKind.USER.name()));
     }
 
     @Test
@@ -185,7 +186,7 @@ public class SyncTaskITCase extends AbstractTaskITCase {
             assertTrue(userTO.getResources().contains(RESOURCE_NAME_TESTDB));
             assertTrue(userTO.getResources().contains(RESOURCE_NAME_WS2));
             assertEquals(1, userTO.getMemberships().size());
-            assertTrue(userTO.getMemberships().get(0).getPlainAttrMap().containsKey("subscriptionDate"));
+            assertEquals(8, userTO.getMemberships().get(0).getRightKey());
 
             // Unmatching --> Assign (link) - SYNCOPE-658
             assertTrue(userTO.getResources().contains(RESOURCE_NAME_CSV));
@@ -378,7 +379,7 @@ public class SyncTaskITCase extends AbstractTaskITCase {
         userTO.getResources().add(RESOURCE_NAME_NOPROPAGATION4);
 
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(7L);
+        membershipTO.setRightKey(7L);
 
         userTO.getMemberships().add(membershipTO);
 
@@ -396,7 +397,7 @@ public class SyncTaskITCase extends AbstractTaskITCase {
             UserTO template = new UserTO();
 
             membershipTO = new MembershipTO();
-            membershipTO.setGroupKey(10L);
+            membershipTO.setRightKey(10L);
 
             template.getMemberships().add(membershipTO);
 
@@ -407,14 +408,14 @@ public class SyncTaskITCase extends AbstractTaskITCase {
             SyncTaskTO task = taskService.read(9L);
             assertNotNull(task);
 
-            task.setUserTemplate(template);
+            task.getTemplates().put(AnyTypeKind.USER.name(), template);
 
             taskService.update(task.getKey(), task);
             SyncTaskTO actual = taskService.read(task.getKey());
             assertNotNull(actual);
             assertEquals(task.getKey(), actual.getKey());
-            assertFalse(actual.getUserTemplate().getResources().isEmpty());
-            assertFalse(actual.getUserTemplate().getMemberships().isEmpty());
+            assertFalse(actual.getTemplates().get(AnyTypeKind.USER.name()).getResources().isEmpty());
+            assertFalse(actual.getTemplates().get(AnyTypeKind.USER.name()).getMemberships().isEmpty());
 
             TaskExecTO execution = execSyncTask(actual.getKey(), 50, false);
             final String status = execution.getStatus();
@@ -464,7 +465,15 @@ public class SyncTaskITCase extends AbstractTaskITCase {
         // Add a custom correlation rule
         // -----------------------------
         SyncPolicyTO policyTO = policyService.read(9L);
-        policyTO.getSpecification().setUserJavaRule(TestSyncRule.class.getName());
+
+        SyncPolicySpecItem item = policyTO.getSpecification().getItem(AnyTypeKind.USER.name());
+        if (item == null) {
+            item = new SyncPolicySpecItem();
+            item.setAnyTypeKey(AnyTypeKind.USER.name());
+
+            policyTO.getSpecification().getItems().add(item);
+        }
+        item.setJavaRule(TestSyncRule.class.getName());
 
         policyService.update(policyTO.getKey(), policyTO);
         // -----------------------------
@@ -571,7 +580,7 @@ public class SyncTaskITCase extends AbstractTaskITCase {
         AttrTO email = attrTO("email", "'s307@apache.org'");
         template.getPlainAttrs().add(email);
 
-        task.setUserTemplate(template);
+        task.getTemplates().put(AnyTypeKind.USER.name(), template);
 
         taskService.update(task.getKey(), task);
         execSyncTask(task.getKey(), 50, false);
@@ -675,7 +684,7 @@ public class SyncTaskITCase extends AbstractTaskITCase {
 
         // 4. Check that the LDAP resource has the old password
         ConnObjectTO connObject =
-                resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, user.getKey());
+                resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), user.getKey());
         assertNotNull(getLdapRemoteObject(
                 connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0),
                 "security123",


Mime
View raw message