syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [01/70] syncope git commit: [SYNCOPE-666] Initial commit, Travis CI builds disabled
Date Thu, 11 Jun 2015 14:16:51 GMT
Repository: syncope
Updated Branches:
  refs/heads/master 2e5fc7ecc -> d8927ef4c


http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java
index 43f0ffb..9c67d13 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java
@@ -44,11 +44,10 @@ import org.apache.commons.lang3.tuple.Pair;
 import org.apache.cxf.common.util.Base64Utility;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.syncope.client.lib.SyncopeClient;
-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.SyncopeConstants;
 import org.apache.syncope.common.lib.mod.AttrMod;
-import org.apache.syncope.common.lib.mod.MembershipMod;
 import org.apache.syncope.common.lib.mod.ResourceAssociationMod;
 import org.apache.syncope.common.lib.mod.StatusMod;
 import org.apache.syncope.common.lib.mod.UserMod;
@@ -66,13 +65,13 @@ import org.apache.syncope.common.lib.to.PropagationTaskTO;
 import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.syncope.common.lib.to.GroupTO;
 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.ClientExceptionType;
 import org.apache.syncope.common.lib.types.MappingPurpose;
 import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
 import org.apache.syncope.common.lib.types.ResourceAssociationActionType;
 import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
-import org.apache.syncope.common.lib.types.SubjectType;
 import org.apache.syncope.common.lib.types.TaskType;
 import org.apache.syncope.common.lib.wrap.ResourceName;
 import org.apache.syncope.common.rest.api.CollectionWrapper;
@@ -312,8 +311,8 @@ public class UserITCase extends AbstractITCase {
         // configured to be minLength=16
         userTO.setPassword("password1");
 
-        final MembershipTO membership = new MembershipTO();
-        membership.setGroupKey(8L);
+        MembershipTO membership = new MembershipTO();
+        membership.setRightKey(8L);
 
         userTO.getMemberships().add(membership);
 
@@ -346,12 +345,9 @@ public class UserITCase extends AbstractITCase {
 
         // add a membership
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(8L);
+        membershipTO.setRightKey(8L);
         userTO.getMemberships().add(membershipTO);
 
-        // add an attribute with no values: must be ignored
-        membershipTO.getPlainAttrs().add(attrTO("subscriptionDate", null));
-
         // add an attribute with a non-existing schema: must be ignored
         AttrTO attrWithInvalidSchemaTO = attrTO("invalid schema", "a value");
         userTO.getPlainAttrs().add(attrWithInvalidSchemaTO);
@@ -445,7 +441,7 @@ public class UserITCase extends AbstractITCase {
         userTO.getPlainAttrs().remove(type);
 
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(8L);
+        membershipTO.setRightKey(8L);
         userTO.getMemberships().add(membershipTO);
 
         // 1. create user without type (mandatory by UserSchema)
@@ -637,8 +633,7 @@ public class UserITCase extends AbstractITCase {
         UserTO userTO = getUniqueSampleTO("g.h@t.com");
 
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(8L);
-        membershipTO.getPlainAttrs().add(attrTO("subscriptionDate", "2009-08-18T16:33:12.203+0200"));
+        membershipTO.setRightKey(8L);
         userTO.getMemberships().add(membershipTO);
 
         userTO = createUser(userTO);
@@ -646,10 +641,6 @@ public class UserITCase extends AbstractITCase {
         assertFalse(userTO.getDerAttrs().isEmpty());
         assertEquals(1, userTO.getMemberships().size());
 
-        MembershipMod membershipMod = new MembershipMod();
-        membershipMod.setGroup(8L);
-        membershipMod.getPlainAttrsToUpdate().add(attrMod("subscriptionDate", "2010-08-18T16:33:12.203+0200"));
-
         UserMod userMod = new UserMod();
         userMod.setKey(userTO.getKey());
         userMod.setPassword("new2Password");
@@ -663,7 +654,7 @@ public class UserITCase extends AbstractITCase {
         userMod.getPlainAttrsToUpdate().add(attrMod("fullname", newFullName));
 
         userMod.getDerAttrsToAdd().add("cn");
-        userMod.getMembershipsToAdd().add(membershipMod);
+        userMod.getMembershipsToAdd().add(8L);
         userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
 
         userTO = updateUser(userMod);
@@ -677,7 +668,6 @@ public class UserITCase extends AbstractITCase {
         assertTrue(userTO.getCreationDate().before(userTO.getLastChangeDate()));
 
         assertEquals(1, userTO.getMemberships().size());
-        assertEquals(1, userTO.getMemberships().iterator().next().getPlainAttrs().size());
         assertFalse(userTO.getDerAttrs().isEmpty());
 
         AttrTO userIdAttr = userTO.getPlainAttrMap().get("userId");
@@ -695,8 +685,7 @@ public class UserITCase extends AbstractITCase {
 
         UserTO userTO = getUniqueSampleTO("pwdonly@t.com");
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(8L);
-        membershipTO.getPlainAttrs().add(attrTO("subscriptionDate", "2009-08-18T16:33:12.203+0200"));
+        membershipTO.setRightKey(8L);
         userTO.getMemberships().add(membershipTO);
 
         userTO = createUser(userTO);
@@ -736,7 +725,7 @@ public class UserITCase extends AbstractITCase {
 
         // add a membership
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(8L);
+        membershipTO.setRightKey(8L);
         userTO.getMemberships().add(membershipTO);
 
         // 1. create user
@@ -811,7 +800,7 @@ public class UserITCase extends AbstractITCase {
         UserTO userTO = getUniqueSampleTO("createActivate@syncope.apache.org");
 
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(11L);
+        membershipTO.setRightKey(11L);
         userTO.getMemberships().add(membershipTO);
 
         userTO = createUser(userTO);
@@ -838,7 +827,7 @@ public class UserITCase extends AbstractITCase {
         UserTO userTO = getUniqueSampleTO("suspendReactivate@syncope.apache.org");
 
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(7L);
+        membershipTO.setRightKey(7L);
         userTO.getMemberships().add(membershipTO);
 
         userTO = createUser(userTO);
@@ -892,10 +881,11 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(userTO);
         assertEquals("suspended", userTO.getStatus());
 
-        ConnObjectTO connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userId);
+        ConnObjectTO connObjectTO =
+                resourceService.readConnObject(RESOURCE_NAME_TESTDB, AnyTypeKind.USER.name(), userId);
         assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
 
-        connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userId);
+        connObjectTO = resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), userId);
         assertNotNull(connObjectTO);
 
         // Suspend and reactivate only on ldap => db and syncope should still show suspended
@@ -909,7 +899,7 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(userTO);
         assertEquals("suspended", userTO.getStatus());
 
-        connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userId);
+        connObjectTO = resourceService.readConnObject(RESOURCE_NAME_TESTDB, AnyTypeKind.USER.name(), userId);
         assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
 
         // Reactivate on syncope and db => syncope and db should show the user as active
@@ -922,7 +912,7 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(userTO);
         assertEquals("active", userTO.getStatus());
 
-        connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userId);
+        connObjectTO = resourceService.readConnObject(RESOURCE_NAME_TESTDB, AnyTypeKind.USER.name(), userId);
         assertTrue(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
     }
 
@@ -1019,7 +1009,7 @@ public class UserITCase extends AbstractITCase {
         toBeUpdated.getVirAttrs().add(virtual);
 
         // 2. try to update by adding a resource, but no password: must fail
-        UserMod userMod = AttributableOperations.diff(toBeUpdated, original);
+        UserMod userMod = AnyOperations.diff(toBeUpdated, original);
         assertNotNull(userMod);
 
         toBeUpdated = updateUser(userMod);
@@ -1115,7 +1105,7 @@ public class UserITCase extends AbstractITCase {
         userTO.getDerAttrs().add(attrTO("csvuserid", null));
 
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(1L);
+        membershipTO.setRightKey(1L);
 
         userTO.getMemberships().add(membershipTO);
 
@@ -1126,40 +1116,12 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(actual.getDerAttrMap().get("csvuserid"));
 
         ConnObjectTO connObjectTO =
-                resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+                resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
         assertNotNull(connObjectTO);
         assertEquals("sx-dx", connObjectTO.getPlainAttrMap().get("THEIRGROUP").getValues().get(0));
     }
 
     @Test
-    public void membershipAttrPropagation() {
-        UserTO userTO = getUniqueSampleTO("checkMembAttrPropagation@syncope.apache.org");
-        userTO.getResources().clear();
-        userTO.getMemberships().clear();
-        userTO.getDerAttrs().clear();
-        userTO.getVirAttrs().clear();
-        userTO.getDerAttrs().add(attrTO("csvuserid", null));
-
-        MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(1L);
-        membershipTO.getPlainAttrs().add(attrTO("mderived_sx", "sx"));
-        membershipTO.getPlainAttrs().add(attrTO("mderived_dx", "dx"));
-        membershipTO.getDerAttrs().add(attrTO("mderToBePropagated", null));
-        userTO.getMemberships().add(membershipTO);
-
-        userTO.getResources().add(RESOURCE_NAME_CSV);
-
-        UserTO actual = createUser(userTO);
-        assertNotNull(actual);
-        assertNotNull(actual.getDerAttrMap().get("csvuserid"));
-
-        ConnObjectTO connObjectTO =
-                resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
-        assertNotNull(connObjectTO);
-        assertEquals("sx-dx", connObjectTO.getPlainAttrMap().get("MEMBERSHIP").getValues().get(0));
-    }
-
-    @Test
     public void noContent() throws IOException {
         SyncopeClient noContentclient = clientFactory.create(ADMIN_UNAME, ADMIN_PWD);
         UserService noContentService = noContentclient.prefer(UserService.class, Preference.RETURN_NO_CONTENT);
@@ -1198,12 +1160,12 @@ public class UserITCase extends AbstractITCase {
         userTO.getDerAttrs().add(attrTO("csvuserid", null));
 
         MembershipTO memb12 = new MembershipTO();
-        memb12.setGroupKey(12L);
+        memb12.setRightKey(12L);
 
         userTO.getMemberships().add(memb12);
 
         MembershipTO memb13 = new MembershipTO();
-        memb13.setGroupKey(13L);
+        memb13.setRightKey(13L);
 
         userTO.getMemberships().add(memb13);
 
@@ -1215,7 +1177,7 @@ public class UserITCase extends AbstractITCase {
         assertEquals(1, actual.getResources().size());
 
         ConnObjectTO connObjectTO =
-                resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+                resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
         assertNotNull(connObjectTO);
 
         // -----------------------------------
@@ -1230,7 +1192,7 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(actual);
         assertEquals(1, actual.getMemberships().size());
 
-        connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+        connObjectTO = resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
         assertNotNull(connObjectTO);
         // -----------------------------------
 
@@ -1247,7 +1209,7 @@ public class UserITCase extends AbstractITCase {
         assertEquals(1, actual.getMemberships().size());
         assertFalse(actual.getResources().isEmpty());
 
-        connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+        connObjectTO = resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
         assertNotNull(connObjectTO);
         // -----------------------------------
 
@@ -1265,7 +1227,7 @@ public class UserITCase extends AbstractITCase {
         assertTrue(actual.getResources().isEmpty());
 
         try {
-            resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+            resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
             fail("Read should not succeeed");
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.NotFound, e.getType());
@@ -1273,74 +1235,6 @@ public class UserITCase extends AbstractITCase {
     }
 
     @Test
-    public void issueSYNCOPE111() {
-        UserTO userTO = getUniqueSampleTO("syncope111@syncope.apache.org");
-        userTO.getResources().clear();
-        userTO.getMemberships().clear();
-        userTO.getDerAttrs().clear();
-        userTO.getVirAttrs().clear();
-        userTO.getDerAttrs().add(attrTO("csvuserid", null));
-
-        MembershipTO memb12 = new MembershipTO();
-        memb12.setGroupKey(12L);
-        memb12.getPlainAttrs().add(attrTO("postalAddress", "postalAddress"));
-        userTO.getMemberships().add(memb12);
-
-        MembershipTO memb13 = new MembershipTO();
-        memb13.setGroupKey(13L);
-        userTO.getMemberships().add(memb13);
-
-        userTO.getResources().add(RESOURCE_NAME_LDAP);
-
-        UserTO actual = createUser(userTO);
-        assertNotNull(actual);
-        assertEquals(2, actual.getMemberships().size());
-
-        ConnObjectTO connObjectTO =
-                resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, actual.getKey());
-        assertNotNull(connObjectTO);
-
-        AttrTO postalAddress = connObjectTO.getPlainAttrMap().get("postalAddress");
-        assertNotNull(postalAddress);
-        assertEquals(1, postalAddress.getValues().size());
-        assertEquals("postalAddress", postalAddress.getValues().get(0));
-
-        AttrTO title = connObjectTO.getPlainAttrMap().get("title");
-        assertNotNull(title);
-        assertEquals(2, title.getValues().size());
-        assertTrue(title.getValues().contains("r12") && title.getValues().contains("r13"));
-
-        // -----------------------------------
-        // Remove the first membership and check for membership attr propagation and group attr propagation
-        // -----------------------------------
-        UserMod userMod = new UserMod();
-        userMod.setKey(actual.getKey());
-
-        MembershipTO membershipTO = actual.getMemberships().get(0).getGroupKey() == 12L
-                ? actual.getMemberships().get(0)
-                : actual.getMemberships().get(1);
-
-        userMod.getMembershipsToRemove().add(membershipTO.getKey());
-
-        actual = updateUser(userMod);
-        assertNotNull(actual);
-        assertEquals(1, actual.getMemberships().size());
-
-        connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, actual.getKey());
-        assertNotNull(connObjectTO);
-
-        postalAddress = connObjectTO.getPlainAttrMap().get("postalAddress");
-        assertTrue(postalAddress == null || postalAddress.getValues().isEmpty()
-                || StringUtils.isNotBlank(postalAddress.getValues().get(0)));
-
-        title = connObjectTO.getPlainAttrMap().get("title");
-        assertNotNull(title);
-        assertEquals(1, title.getValues().size());
-        assertTrue(title.getValues().contains("r13"));
-        // -----------------------------------
-    }
-
-    @Test
     public void issueSYNCOPE185() {
         // 1. create user with LDAP resource, succesfully propagated
         UserTO userTO = getSampleTO("syncope185@syncope.apache.org");
@@ -1358,7 +1252,7 @@ public class UserITCase extends AbstractITCase {
 
         // 3. try (and fail) to find this user on the external LDAP resource
         try {
-            resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getKey());
+            resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), userTO.getKey());
             fail("This entry should not be present on this resource");
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.NotFound, e.getType());
@@ -1409,7 +1303,7 @@ public class UserITCase extends AbstractITCase {
         assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
 
         ConnObjectTO connObjectTO =
-                resourceService.getConnectorObject(RESOURCE_NAME_DBVIRATTR, SubjectType.USER, userTO.getKey());
+                resourceService.readConnObject(RESOURCE_NAME_DBVIRATTR, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(connObjectTO);
         assertEquals("virtualvalue", connObjectTO.getPlainAttrMap().get("USERNAME").getValues().get(0));
         // ----------------------------------
@@ -1466,16 +1360,16 @@ public class UserITCase extends AbstractITCase {
 
         final String pwdOnSyncope = userTO.getPassword();
 
-        ConnObjectTO userOnDb = resourceService.getConnectorObject(
-                RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getKey());
+        ConnObjectTO userOnDb = resourceService.readConnObject(
+                RESOURCE_NAME_TESTDB, AnyTypeKind.USER.name(), userTO.getKey());
         final AttrTO pwdOnTestDbAttr = userOnDb.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
         assertNotNull(pwdOnTestDbAttr);
         assertNotNull(pwdOnTestDbAttr.getValues());
         assertFalse(pwdOnTestDbAttr.getValues().isEmpty());
         final String pwdOnTestDb = pwdOnTestDbAttr.getValues().iterator().next();
 
-        ConnObjectTO userOnDb2 = resourceService.getConnectorObject(
-                RESOURCE_NAME_TESTDB2, SubjectType.USER, userTO.getKey());
+        ConnObjectTO userOnDb2 = resourceService.readConnObject(
+                RESOURCE_NAME_TESTDB2, AnyTypeKind.USER.name(), userTO.getKey());
         final AttrTO pwdOnTestDb2Attr = userOnDb2.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
         assertNotNull(pwdOnTestDb2Attr);
         assertNotNull(pwdOnTestDb2Attr.getValues());
@@ -1502,7 +1396,7 @@ public class UserITCase extends AbstractITCase {
         assertEquals(pwdOnSyncope, userTO.getPassword());
 
         // 3c. verify that password *has* changed on testdb
-        userOnDb = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getKey());
+        userOnDb = resourceService.readConnObject(RESOURCE_NAME_TESTDB, AnyTypeKind.USER.name(), userTO.getKey());
         final AttrTO pwdOnTestDbAttrAfter = userOnDb.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
         assertNotNull(pwdOnTestDbAttrAfter);
         assertNotNull(pwdOnTestDbAttrAfter.getValues());
@@ -1510,7 +1404,7 @@ public class UserITCase extends AbstractITCase {
         assertNotEquals(pwdOnTestDb, pwdOnTestDbAttrAfter.getValues().iterator().next());
 
         // 3d. verify that password hasn't changed on testdb2
-        userOnDb2 = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB2, SubjectType.USER, userTO.getKey());
+        userOnDb2 = resourceService.readConnObject(RESOURCE_NAME_TESTDB2, AnyTypeKind.USER.name(), userTO.getKey());
         final AttrTO pwdOnTestDb2AttrAfter = userOnDb2.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
         assertNotNull(pwdOnTestDb2AttrAfter);
         assertNotNull(pwdOnTestDb2AttrAfter.getValues());
@@ -1608,7 +1502,7 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(actual);
 
         ConnObjectTO connObjectTO =
-                resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+                resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
         assertNull(connObjectTO.getPlainAttrMap().get("email"));
     }
 
@@ -1668,7 +1562,7 @@ public class UserITCase extends AbstractITCase {
     public void issueSYNCOPE354() {
         // change resource-ldap group mapping for including uniqueMember (need for assertions below)
         ResourceTO ldap = resourceService.read(RESOURCE_NAME_LDAP);
-        for (MappingItemTO item : ldap.getGmapping().getItems()) {
+        for (MappingItemTO item : ldap.getProvision(AnyTypeKind.GROUP.name()).getMapping().getItems()) {
             if ("description".equals(item.getExtAttrName())) {
                 item.setExtAttrName("uniqueMember");
             }
@@ -1688,15 +1582,15 @@ public class UserITCase extends AbstractITCase {
         UserTO userTO = getUniqueSampleTO("syncope354@syncope.apache.org");
         userTO.getResources().add(RESOURCE_NAME_LDAP);
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(groupTO.getKey());
+        membershipTO.setRightKey(groupTO.getKey());
         userTO.getMemberships().add(membershipTO);
 
         userTO = createUser(userTO);
         assertTrue(userTO.getResources().contains(RESOURCE_NAME_LDAP));
 
         // 3. read group on resource, check that user DN is included in uniqueMember
-        ConnObjectTO connObj = resourceService.getConnectorObject(
-                RESOURCE_NAME_LDAP, SubjectType.GROUP, groupTO.getKey());
+        ConnObjectTO connObj = resourceService.readConnObject(
+                RESOURCE_NAME_LDAP, AnyTypeKind.GROUP.name(), groupTO.getKey());
         assertNotNull(connObj);
         assertTrue(connObj.getPlainAttrMap().get("uniqueMember").getValues().
                 contains("uid=" + userTO.getUsername() + ",ou=people,o=isp"));
@@ -1710,13 +1604,13 @@ public class UserITCase extends AbstractITCase {
         assertTrue(userTO.getResources().contains(RESOURCE_NAME_LDAP));
 
         // 5. read group on resource, check that user DN was removed from uniqueMember
-        connObj = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.GROUP, groupTO.getKey());
+        connObj = resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.GROUP.name(), groupTO.getKey());
         assertNotNull(connObj);
         assertFalse(connObj.getPlainAttrMap().get("uniqueMember").getValues().
                 contains("uid=" + userTO.getUsername() + ",ou=people,o=isp"));
 
         // 6. restore original resource-ldap group mapping
-        for (MappingItemTO item : ldap.getGmapping().getItems()) {
+        for (MappingItemTO item : ldap.getProvision(AnyTypeKind.GROUP.name()).getMapping().getItems()) {
             if ("uniqueMember".equals(item.getExtAttrName())) {
                 item.setExtAttrName("description");
             }
@@ -1741,7 +1635,7 @@ public class UserITCase extends AbstractITCase {
         userTO.getPlainAttrs().add(attrTO("photo",
                 Base64Utility.encode(IOUtils.readBytesFromStream(getClass().getResourceAsStream("/favicon.jpg")))));
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(groupTO.getKey());
+        membershipTO.setRightKey(groupTO.getKey());
         userTO.getMemberships().add(membershipTO);
 
         userTO = createUser(userTO);
@@ -1750,8 +1644,8 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(userTO.getPlainAttrMap().get("photo"));
 
         // 3. read user on resource
-        ConnObjectTO connObj = resourceService.getConnectorObject(
-                RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getKey());
+        ConnObjectTO connObj = resourceService.readConnObject(
+                RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(connObj);
         AttrTO registeredAddress = connObj.getPlainAttrMap().get("registeredAddress");
         assertNotNull(registeredAddress);
@@ -1765,7 +1659,7 @@ public class UserITCase extends AbstractITCase {
 
         // 5. try to read user on resource: fail
         try {
-            resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getKey());
+            resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), userTO.getKey());
             fail();
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.NotFound, e.getType());
@@ -1857,7 +1751,7 @@ public class UserITCase extends AbstractITCase {
 
         UserTO actual = createUser(userTO);
         assertNotNull(actual);
-        assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
+        assertNotNull(resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey()));
 
         assertNotNull(userService.bulkDeassociation(actual.getKey(),
                 ResourceDeassociationActionType.UNLINK,
@@ -1868,7 +1762,7 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(actual);
         assertTrue(actual.getResources().isEmpty());
 
-        assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
+        assertNotNull(resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey()));
     }
 
     @Test
@@ -1885,7 +1779,7 @@ public class UserITCase extends AbstractITCase {
         assertTrue(actual.getResources().isEmpty());
 
         try {
-            resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+            resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
             fail();
         } catch (Exception e) {
             assertNotNull(e);
@@ -1902,7 +1796,7 @@ public class UserITCase extends AbstractITCase {
         assertFalse(actual.getResources().isEmpty());
 
         try {
-            resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+            resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
             fail();
         } catch (Exception e) {
             assertNotNull(e);
@@ -1921,7 +1815,7 @@ public class UserITCase extends AbstractITCase {
 
         UserTO actual = createUser(userTO);
         assertNotNull(actual);
-        assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
+        assertNotNull(resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey()));
 
         assertNotNull(userService.bulkDeassociation(actual.getKey(),
                 ResourceDeassociationActionType.UNASSIGN,
@@ -1933,7 +1827,7 @@ public class UserITCase extends AbstractITCase {
         assertTrue(actual.getResources().isEmpty());
 
         try {
-            resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+            resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
             fail();
         } catch (Exception e) {
             assertNotNull(e);
@@ -1954,7 +1848,7 @@ public class UserITCase extends AbstractITCase {
         assertTrue(actual.getResources().isEmpty());
 
         try {
-            resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+            resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
             fail();
         } catch (Exception e) {
             assertNotNull(e);
@@ -1971,7 +1865,7 @@ public class UserITCase extends AbstractITCase {
         actual = userService.read(actual.getKey());
         assertNotNull(actual);
         assertFalse(actual.getResources().isEmpty());
-        assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
+        assertNotNull(resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey()));
     }
 
     @Test
@@ -1986,7 +1880,7 @@ public class UserITCase extends AbstractITCase {
 
         UserTO actual = createUser(userTO);
         assertNotNull(actual);
-        assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
+        assertNotNull(resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey()));
 
         assertNotNull(userService.bulkDeassociation(actual.getKey(),
                 ResourceDeassociationActionType.DEPROVISION,
@@ -1998,7 +1892,7 @@ public class UserITCase extends AbstractITCase {
         assertFalse(actual.getResources().isEmpty());
 
         try {
-            resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+            resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
             fail();
         } catch (Exception e) {
             assertNotNull(e);
@@ -2019,7 +1913,7 @@ public class UserITCase extends AbstractITCase {
         assertTrue(actual.getResources().isEmpty());
 
         try {
-            resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+            resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
             fail();
         } catch (Exception e) {
             assertNotNull(e);
@@ -2037,7 +1931,7 @@ public class UserITCase extends AbstractITCase {
         actual = userService.read(actual.getKey());
         assertNotNull(actual);
         assertTrue(actual.getResources().isEmpty());
-        assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
+        assertNotNull(resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey()));
     }
 
     @Test
@@ -2054,7 +1948,7 @@ public class UserITCase extends AbstractITCase {
         assertTrue(actual.getResources().isEmpty());
 
         try {
-            resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+            resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
             fail();
         } catch (Exception e) {
             assertNotNull(e);
@@ -2072,7 +1966,7 @@ public class UserITCase extends AbstractITCase {
         actual = userService.read(actual.getKey());
         assertNotNull(actual);
         assertTrue(actual.getResources().isEmpty());
-        assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
+        assertNotNull(resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey()));
 
         assertNotNull(userService.bulkDeassociation(actual.getKey(),
                 ResourceDeassociationActionType.DEPROVISION,
@@ -2084,7 +1978,7 @@ public class UserITCase extends AbstractITCase {
         assertTrue(actual.getResources().isEmpty());
 
         try {
-            resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+            resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
             fail();
         } catch (Exception e) {
             assertNotNull(e);
@@ -2181,7 +2075,7 @@ public class UserITCase extends AbstractITCase {
 
         // 2. read resource configuration for LDAP binding
         ConnObjectTO connObject =
-                resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getKey());
+                resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), userTO.getKey());
 
         // 3. try (and succeed) to perform simple LDAP binding with provided password ('password123')
         assertNotNull(getLdapRemoteObject(
@@ -2214,8 +2108,8 @@ public class UserITCase extends AbstractITCase {
         assertEquals(1, userTO.getPropagationStatusTOs().size());
         assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
 
-        final ConnObjectTO actual = resourceService.getConnectorObject(RESOURCE_NAME_WS1, SubjectType.USER, userTO.
-                getKey());
+        ConnObjectTO actual =
+                resourceService.readConnObject(RESOURCE_NAME_WS1, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(actual);
         // check if mapping attribute with purpose NONE really hasn't been propagated
         assertNull(actual.getPlainAttrMap().get("NAME"));
@@ -2224,7 +2118,7 @@ public class UserITCase extends AbstractITCase {
         ResourceTO ws1 = resourceService.read(RESOURCE_NAME_WS1);
         assertNotNull(ws1);
 
-        MappingTO ws1NewUMapping = ws1.getUmapping();
+        MappingTO ws1NewUMapping = ws1.getProvision(AnyTypeKind.USER.name()).getMapping();
         // change purpose from NONE to BOTH
         for (MappingItemTO itemTO : ws1NewUMapping.getItems()) {
             if ("firstname".equals(itemTO.getIntAttrName())) {
@@ -2232,15 +2126,14 @@ public class UserITCase extends AbstractITCase {
             }
         }
 
-        ws1.setUmapping(ws1NewUMapping);
-        ws1.setGmapping(ws1.getGmapping());
+        ws1.getProvision(AnyTypeKind.USER.name()).setMapping(ws1NewUMapping);
 
         resourceService.update(RESOURCE_NAME_WS1, ws1);
         ResourceTO newWs1 = resourceService.read(ws1.getKey());
         assertNotNull(newWs1);
 
         // check for existence
-        Collection<MappingItemTO> mapItems = newWs1.getUmapping().getItems();
+        Collection<MappingItemTO> mapItems = newWs1.getProvision(AnyTypeKind.USER.name()).getMapping().getItems();
         assertNotNull(mapItems);
         assertEquals(7, mapItems.size());
 
@@ -2255,14 +2148,14 @@ public class UserITCase extends AbstractITCase {
         assertEquals(1, userTO.getPropagationStatusTOs().size());
         assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
 
-        final ConnObjectTO newUser = resourceService.getConnectorObject(RESOURCE_NAME_WS1, SubjectType.USER,
-                userTO.getKey());
+        ConnObjectTO newUser =
+                resourceService.readConnObject(RESOURCE_NAME_WS1, AnyTypeKind.USER.name(), userTO.getKey());
 
         assertNotNull(newUser.getPlainAttrMap().get("NAME"));
         assertEquals("firstnameNew", newUser.getPlainAttrMap().get("NAME").getValues().get(0));
 
         // 4.  restore resource ws-target-resource-1 mapping
-        ws1NewUMapping = newWs1.getUmapping();
+        ws1NewUMapping = newWs1.getProvision(AnyTypeKind.USER.name()).getMapping();
         // restore purpose from BOTH to NONE
         for (MappingItemTO itemTO : ws1NewUMapping.getItems()) {
             if ("firstname".equals(itemTO.getIntAttrName())) {
@@ -2270,8 +2163,7 @@ public class UserITCase extends AbstractITCase {
             }
         }
 
-        newWs1.setUmapping(ws1NewUMapping);
-        newWs1.setGmapping(newWs1.getGmapping());
+        newWs1.getProvision(AnyTypeKind.USER.name()).setMapping(ws1NewUMapping);
 
         resourceService.update(RESOURCE_NAME_WS1, newWs1);
     }
@@ -2350,7 +2242,7 @@ public class UserITCase extends AbstractITCase {
 
         // 4. Check that the LDAP resource has the correct 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),
@@ -2393,7 +2285,7 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(userTO);
 
         ConnObjectTO connObjectTO =
-                resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, userTO.getKey());
+                resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(connObjectTO);
 
         // check if password has not changed
@@ -2414,7 +2306,7 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(userTO);
 
         connObjectTO =
-                resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, userTO.getKey());
+                resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(connObjectTO);
 
         // check if password has been propagated and that saved userTO's password is null
@@ -2435,7 +2327,7 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(userTO);
 
         connObjectTO =
-                resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, userTO.getKey());
+                resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(connObjectTO);
 
         // check if password has been correctly propagated on Syncope and resource-csv as usual
@@ -2480,8 +2372,7 @@ public class UserITCase extends AbstractITCase {
         userTO.getDerAttrs().add(attrTO("csvuserid", null));
 
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(12L);
-        membershipTO.getPlainAttrs().add(attrTO("postalAddress", "postalAddress"));
+        membershipTO.setRightKey(12L);
         userTO.getMemberships().add(membershipTO);
 
         userTO.getResources().add(RESOURCE_NAME_LDAP);
@@ -2491,22 +2382,19 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(actual.getDerAttrMap().get("csvuserid"));
 
         ConnObjectTO connObjectTO =
-                resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, actual.getKey());
+                resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), actual.getKey());
         assertNotNull(connObjectTO);
         assertEquals("postalAddress", connObjectTO.getPlainAttrMap().get("postalAddress").getValues().get(0));
 
         UserMod userMod = new UserMod();
         userMod.setKey(actual.getKey());
 
-        MembershipMod membershipMod = new MembershipMod();
-        membershipMod.setGroup(12L);
-        membershipMod.getPlainAttrsToUpdate().add(attrMod("postalAddress", "newPostalAddress"));
-        userMod.getMembershipsToAdd().add(membershipMod);
+        userMod.getMembershipsToAdd().add(12L);
         userMod.getMembershipsToRemove().add(actual.getMemberships().iterator().next().getKey());
 
         actual = updateUser(userMod);
 
-        connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, actual.getKey());
+        connObjectTO = resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), actual.getKey());
         assertNotNull(connObjectTO);
         assertEquals("newPostalAddress", connObjectTO.getPlainAttrMap().get("postalAddress").getValues().get(0));
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserSelfITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserSelfITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserSelfITCase.java
index 14e2f9f..fdd25bd 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserSelfITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserSelfITCase.java
@@ -37,16 +37,14 @@ import org.apache.commons.lang3.tuple.Pair;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.syncope.client.lib.SyncopeClient;
 import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.mod.AttrMod;
-import org.apache.syncope.common.lib.mod.MembershipMod;
 import org.apache.syncope.common.lib.mod.StatusMod;
 import org.apache.syncope.common.lib.mod.UserMod;
 import org.apache.syncope.common.lib.to.MembershipTO;
 import org.apache.syncope.common.lib.to.UserTO;
 import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
 import org.apache.syncope.common.lib.to.WorkflowFormTO;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.SubjectType;
 import org.apache.syncope.common.rest.api.Preference;
 import org.apache.syncope.common.rest.api.RESTHeaders;
 import org.apache.syncope.common.rest.api.service.UserSelfService;
@@ -93,7 +91,7 @@ public class UserSelfITCase extends AbstractITCase {
         // self-create user with membership: goes 'createApproval' with resources and membership but no propagation
         UserTO userTO = UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org");
         MembershipTO membership = new MembershipTO();
-        membership.setGroupKey(3L);
+        membership.setRightKey(3L);
         userTO.getMemberships().add(membership);
         userTO.getResources().add(RESOURCE_NAME_TESTDB);
 
@@ -107,7 +105,7 @@ public class UserSelfITCase extends AbstractITCase {
         assertFalse(userTO.getResources().isEmpty());
 
         try {
-            resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getKey());
+            resourceService.readConnObject(RESOURCE_NAME_TESTDB, AnyTypeKind.USER.name(), userTO.getKey());
             fail();
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.NotFound, e.getType());
@@ -123,7 +121,7 @@ public class UserSelfITCase extends AbstractITCase {
         userTO = userWorkflowService.submitForm(form);
         assertNotNull(userTO);
         assertEquals("active", userTO.getStatus());
-        assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getKey()));
+        assertNotNull(resourceService.readConnObject(RESOURCE_NAME_TESTDB, AnyTypeKind.USER.name(), userTO.getKey()));
     }
 
     @Test
@@ -171,16 +169,9 @@ public class UserSelfITCase extends AbstractITCase {
         assertFalse(created.getUsername().endsWith("XX"));
 
         // 2. self-update (username + memberships + resource) - works but needs approval
-        MembershipMod membershipMod = new MembershipMod();
-        membershipMod.setGroup(7L);
-        AttrMod testAttrMod = new AttrMod();
-        testAttrMod.setSchema("testAttribute");
-        testAttrMod.getValuesToBeAdded().add("a value");
-        membershipMod.getPlainAttrsToUpdate().add(testAttrMod);
-
         UserMod userMod = new UserMod();
         userMod.setUsername(created.getUsername() + "XX");
-        userMod.getMembershipsToAdd().add(membershipMod);
+        userMod.getMembershipsToAdd().add(7L);
         userMod.getResourcesToAdd().add(RESOURCE_NAME_TESTDB);
         userMod.setPassword("newPassword123");
         StatusMod statusMod = new StatusMod();
@@ -199,7 +190,7 @@ public class UserSelfITCase extends AbstractITCase {
         // no propagation happened
         assertTrue(updated.getResources().isEmpty());
         try {
-            resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, updated.getKey());
+            resourceService.readConnObject(RESOURCE_NAME_TESTDB, AnyTypeKind.USER.name(), updated.getKey());
             fail();
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.NotFound, e.getType());
@@ -220,7 +211,7 @@ public class UserSelfITCase extends AbstractITCase {
 
         // check that propagation also happened
         assertTrue(updated.getResources().contains(RESOURCE_NAME_TESTDB));
-        assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, updated.getKey()));
+        assertNotNull(resourceService.readConnObject(RESOURCE_NAME_TESTDB, AnyTypeKind.USER.name(), updated.getKey()));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserWorkflowITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserWorkflowITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserWorkflowITCase.java
index 2432917..457f66d 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserWorkflowITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserWorkflowITCase.java
@@ -56,14 +56,14 @@ public class UserWorkflowITCase extends AbstractITCase {
 
         // User with group 9 are defined in workflow as subject to approval
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(9L);
+        membershipTO.setRightKey(9L);
         userTO.getMemberships().add(membershipTO);
 
         // 1. create user with group 9
         userTO = createUser(userTO);
         assertNotNull(userTO);
         assertEquals(1, userTO.getMemberships().size());
-        assertEquals(9, userTO.getMemberships().get(0).getGroupKey());
+        assertEquals(9, userTO.getMemberships().get(0).getRightKey());
         assertEquals("createApproval", userTO.getStatus());
 
         // 2. request if there is any pending task for user just created
@@ -130,14 +130,14 @@ public class UserWorkflowITCase extends AbstractITCase {
 
         // User with group 9 are defined in workflow as subject to approval
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(9L);
+        membershipTO.setRightKey(9L);
         userTO.getMemberships().add(membershipTO);
 
         // 1. create user with group 9 (and verify that no propagation occurred)
         userTO = createUser(userTO);
         assertNotNull(userTO);
         assertEquals(1, userTO.getMemberships().size());
-        assertEquals(9, userTO.getMemberships().get(0).getGroupKey());
+        assertEquals(9, userTO.getMemberships().get(0).getRightKey());
         assertEquals("createApproval", userTO.getStatus());
         assertEquals(Collections.singleton(RESOURCE_NAME_TESTDB), userTO.getResources());
 
@@ -216,7 +216,7 @@ public class UserWorkflowITCase extends AbstractITCase {
 
         // User with group 9 are defined in workflow as subject to approval
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(9L);
+        membershipTO.setRightKey(9L);
         userTO.getMemberships().add(membershipTO);
 
         // 1. create user with group 9 (and verify that no propagation occurred)

http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirAttrITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirAttrITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirAttrITCase.java
index 5001e5d..e161258 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirAttrITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirAttrITCase.java
@@ -26,9 +26,7 @@ import static org.junit.Assert.assertTrue;
 import java.util.Collections;
 import java.util.Map;
 import org.apache.commons.lang3.SerializationUtils;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.lib.mod.AttrMod;
-import org.apache.syncope.common.lib.mod.MembershipMod;
 import org.apache.syncope.common.lib.mod.StatusMod;
 import org.apache.syncope.common.lib.mod.UserMod;
 import org.apache.syncope.common.lib.to.AttrTO;
@@ -39,13 +37,15 @@ import org.apache.syncope.common.lib.to.MappingTO;
 import org.apache.syncope.common.lib.to.MembershipTO;
 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.UserTO;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.ConnConfProperty;
 import org.apache.syncope.common.lib.types.IntMappingType;
 import org.apache.syncope.common.lib.types.MappingPurpose;
 import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
-import org.apache.syncope.common.lib.types.SubjectType;
 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;
@@ -59,7 +59,7 @@ public class VirAttrITCase extends AbstractITCase {
         UserTO userTO = UserITCase.getUniqueSampleTO("issue16@apache.org");
 
         MembershipTO membershipTO = new MembershipTO();
-        membershipTO.setGroupKey(8L);
+        membershipTO.setRightKey(8L);
         userTO.getMemberships().add(membershipTO);
 
         // 1. create user
@@ -101,7 +101,7 @@ public class VirAttrITCase extends AbstractITCase {
         assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
 
         ConnObjectTO connObjectTO =
-                resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
+                resourceService.readConnObject(RESOURCE_NAME_WS2, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(connObjectTO);
         assertEquals("virtualvalue", connObjectTO.getPlainAttrMap().get("NAME").getValues().get(0));
         // ----------------------------------
@@ -125,7 +125,7 @@ public class VirAttrITCase extends AbstractITCase {
         assertEquals("ws-target-resource-2", userTO.getPropagationStatusTOs().get(0).getResource());
         assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
 
-        connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
+        connObjectTO = resourceService.readConnObject(RESOURCE_NAME_WS2, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(connObjectTO);
         assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("NAME").getValues().get(0));
         // ----------------------------------
@@ -138,7 +138,7 @@ public class VirAttrITCase extends AbstractITCase {
         userTO = userService.status(userTO.getKey(), statusMod).readEntity(UserTO.class);
         assertEquals("suspended", userTO.getStatus());
 
-        connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
+        connObjectTO = resourceService.readConnObject(RESOURCE_NAME_WS2, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(connObjectTO);
         assertFalse(connObjectTO.getPlainAttrMap().get("NAME").getValues().isEmpty());
         assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("NAME").getValues().get(0));
@@ -148,7 +148,7 @@ public class VirAttrITCase extends AbstractITCase {
         userTO = userService.status(userTO.getKey(), statusMod).readEntity(UserTO.class);
         assertEquals("active", userTO.getStatus());
 
-        connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
+        connObjectTO = resourceService.readConnObject(RESOURCE_NAME_WS2, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(connObjectTO);
         assertFalse(connObjectTO.getPlainAttrMap().get("NAME").getValues().isEmpty());
         assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("NAME").getValues().get(0));
@@ -173,7 +173,7 @@ public class VirAttrITCase extends AbstractITCase {
         assertEquals(RESOURCE_NAME_WS2, userTO.getPropagationStatusTOs().get(0).getResource());
         assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
 
-        connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
+        connObjectTO = resourceService.readConnObject(RESOURCE_NAME_WS2, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(connObjectTO);
         assertEquals("Surname2", connObjectTO.getPlainAttrMap().get("SURNAME").getValues().get(0));
 
@@ -196,7 +196,7 @@ public class VirAttrITCase extends AbstractITCase {
         assertEquals(RESOURCE_NAME_WS2, userTO.getPropagationStatusTOs().get(0).getResource());
         assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
 
-        connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
+        connObjectTO = resourceService.readConnObject(RESOURCE_NAME_WS2, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(connObjectTO);
 
         // attribute "name" mapped on virtual attribute "virtualdata" should be reset
@@ -267,11 +267,11 @@ public class VirAttrITCase extends AbstractITCase {
     @Test
     public void issueSYNCOPE397() {
         ResourceTO csv = resourceService.read(RESOURCE_NAME_CSV);
-        final MappingTO origMapping = SerializationUtils.clone(csv.getUmapping());
+        MappingTO origMapping = SerializationUtils.clone(csv.getProvisions().get(0).getMapping());
         try {
             // change mapping of resource-csv
             assertNotNull(origMapping);
-            for (MappingItemTO item : csv.getUmapping().getItems()) {
+            for (MappingItemTO item : csv.getProvisions().get(0).getMapping().getItems()) {
                 if ("email".equals(item.getIntAttrName())) {
                     // unset internal attribute mail and set virtual attribute virtualdata as mapped to external email
                     item.setIntMappingType(IntMappingType.UserVirtualSchema);
@@ -283,10 +283,10 @@ public class VirAttrITCase extends AbstractITCase {
 
             resourceService.update(csv.getKey(), csv);
             csv = resourceService.read(RESOURCE_NAME_CSV);
-            assertNotNull(csv.getUmapping());
+            assertNotNull(csv.getProvisions().get(0).getMapping());
 
             boolean found = false;
-            for (MappingItemTO item : csv.getUmapping().getItems()) {
+            for (MappingItemTO item : csv.getProvisions().get(0).getMapping().getItems()) {
                 if ("email".equals(item.getExtAttrName()) && "virtualdata".equals(item.getIntAttrName())) {
                     found = true;
                 }
@@ -335,7 +335,7 @@ public class VirAttrITCase extends AbstractITCase {
             assertEquals(2, toBeUpdated.getPropagationStatusTOs().size());
         } finally {
             // restore mapping of resource-csv
-            csv.setUmapping(origMapping);
+            csv.getProvisions().get(0).setMapping(origMapping);
             resourceService.update(csv.getKey(), csv);
         }
     }
@@ -447,12 +447,18 @@ public class VirAttrITCase extends AbstractITCase {
         // -------------------------------------------
         // Create a resource ad-hoc
         // -------------------------------------------
-        final ResourceTO resourceTO = new ResourceTO();
+        ResourceTO resourceTO = new ResourceTO();
 
         resourceTO.setKey(resourceName);
         resourceTO.setConnectorId(107L);
 
+        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.setIntAttrName("aLong");
@@ -460,7 +466,7 @@ public class VirAttrITCase extends AbstractITCase {
         item.setExtAttrName(groupName);
         item.setPurpose(MappingPurpose.PROPAGATION);
         item.setAccountid(true);
-        mapping.setAccountIdItem(item);
+        mapping.setConnObjectKeyItem(item);
 
         item = new MappingItemTO();
         item.setExtAttrName("USERNAME");
@@ -476,7 +482,6 @@ public class VirAttrITCase extends AbstractITCase {
         item.setPurpose(MappingPurpose.PROPAGATION);
         mapping.getItems().add(item);
 
-        resourceTO.setUmapping(mapping);
         assertNotNull(getObject(
                 resourceService.create(resourceTO).getLocation(), ResourceService.class, ResourceTO.class));
         // -------------------------------------------
@@ -487,7 +492,6 @@ public class VirAttrITCase extends AbstractITCase {
         GroupTO groupTO = new GroupTO();
         groupTO.setName(groupName);
         groupTO.setRealm("/");
-        groupTO.getGVirAttrTemplates().add("rvirtualdata");
         groupTO.getVirAttrs().add(attrTO("rvirtualdata", "ml@group.it"));
         groupTO.getResources().add(RESOURCE_NAME_LDAP);
         groupTO = createGroup(groupTO);
@@ -507,8 +511,7 @@ public class VirAttrITCase extends AbstractITCase {
         userTO.getMemberships().clear();
 
         MembershipTO membership = new MembershipTO();
-        membership.setGroupKey(groupTO.getKey());
-        membership.getVirAttrs().add(attrTO("mvirtualdata", "mvirtualvalue"));
+        membership.setRightKey(groupTO.getKey());
         userTO.getMemberships().add(membership);
 
         userTO = createUser(userTO);
@@ -541,7 +544,7 @@ public class VirAttrITCase extends AbstractITCase {
         userTO.getMemberships().clear();
         userTO.getVirAttrs().clear();
 
-        final AttrTO virtualReadOnly = attrTO("virtualReadOnly", "");
+        AttrTO virtualReadOnly = attrTO("virtualReadOnly", "");
         virtualReadOnly.getValues().clear();
 
         userTO.getVirAttrs().add(virtualReadOnly);
@@ -563,174 +566,7 @@ public class VirAttrITCase extends AbstractITCase {
     }
 
     @Test
-    public void issueSYNCOPE458() {
-        // -------------------------------------------
-        // Create a group ad-hoc
-        // -------------------------------------------
-        final String groupName = "issueSYNCOPE458-Group-" + getUUIDString();
-        GroupTO groupTO = new GroupTO();
-        groupTO.setName(groupName);
-        groupTO.setRealm("/");
-        groupTO.getMVirAttrTemplates().add("mvirtualdata");
-        groupTO = createGroup(groupTO);
-        // -------------------------------------------
-
-        // -------------------------------------------
-        // Update resource-db-virattr mapping adding new membership virtual schema mapping
-        // -------------------------------------------
-        ResourceTO resourceDBVirAttr = resourceService.read(RESOURCE_NAME_DBVIRATTR);
-        assertNotNull(resourceDBVirAttr);
-
-        final MappingTO resourceUMapping = resourceDBVirAttr.getUmapping();
-
-        MappingItemTO item = new MappingItemTO();
-        item.setIntAttrName("mvirtualdata");
-        item.setIntMappingType(IntMappingType.MembershipVirtualSchema);
-        item.setExtAttrName("EMAIL");
-        item.setPurpose(MappingPurpose.BOTH);
-
-        resourceUMapping.addItem(item);
-
-        resourceDBVirAttr.setUmapping(resourceUMapping);
-
-        resourceService.update(RESOURCE_NAME_DBVIRATTR, resourceDBVirAttr);
-        // -------------------------------------------
-
-        // -------------------------------------------
-        // Create new user
-        // -------------------------------------------
-        UserTO userTO = UserITCase.getUniqueSampleTO("syncope458@syncope.apache.org");
-        userTO.getResources().clear();
-        userTO.getResources().add(RESOURCE_NAME_DBVIRATTR);
-        userTO.getVirAttrs().clear();
-        userTO.getDerAttrs().clear();
-        userTO.getMemberships().clear();
-
-        // add membership, with virtual attribute populated, to user
-        MembershipTO membership = new MembershipTO();
-        membership.setGroupKey(groupTO.getKey());
-        membership.getVirAttrs().add(attrTO("mvirtualdata", "syncope458@syncope.apache.org"));
-        userTO.getMemberships().add(membership);
-
-        // propagate user
-        userTO = createUser(userTO);
-        assertEquals(1, userTO.getPropagationStatusTOs().size());
-        assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
-       // -------------------------------------------
-
-        // 1. check if membership has virtual attribute populated
-        assertNotNull(userTO.getMemberships().get(0).getVirAttrMap().get("mvirtualdata"));
-        assertEquals("syncope458@syncope.apache.org",
-                userTO.getMemberships().get(0).getVirAttrMap().get("mvirtualdata").getValues().get(0));
-        // -------------------------------------------
-
-        // 2. update membership virtual attribute
-        MembershipMod membershipMod = new MembershipMod();
-        membershipMod.setGroup(groupTO.getKey());
-        membershipMod.getVirAttrsToUpdate().add(attrMod("mvirtualdata", "syncope458_NEW@syncope.apache.org"));
-
-        UserMod userMod = new UserMod();
-        userMod.setKey(userTO.getKey());
-        userMod.getMembershipsToAdd().add(membershipMod);
-        userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
-
-        userTO = updateUser(userMod);
-        assertNotNull(userTO);
-        // 3. check again after update if membership has virtual attribute populated with new value
-        assertNotNull(userTO.getMemberships().get(0).getVirAttrMap().get("mvirtualdata"));
-        assertEquals("syncope458_NEW@syncope.apache.org", userTO.getMemberships().get(0).getVirAttrMap().get(
-                "mvirtualdata").getValues().get(0));
-
-        // ----------------------------------------
-        // force cache expiring without any modification
-        // ----------------------------------------
-        String jdbcURL = null;
-        ConnInstanceTO connInstanceBean = connectorService.readByResource(RESOURCE_NAME_DBVIRATTR);
-        for (ConnConfProperty prop : connInstanceBean.getConfiguration()) {
-            if ("jdbcUrlTemplate".equals(prop.getSchema().getName())) {
-                jdbcURL = prop.getValues().iterator().next().toString();
-                prop.getValues().clear();
-                prop.getValues().add("jdbc:h2:tcp://localhost:9092/xxx");
-            }
-        }
-
-        connectorService.update(connInstanceBean.getKey(), connInstanceBean);
-
-        membershipMod = new MembershipMod();
-        membershipMod.setGroup(groupTO.getKey());
-        membershipMod.getVirAttrsToUpdate().add(attrMod("mvirtualdata", "syncope458_updated@syncope.apache.org"));
-
-        userMod = new UserMod();
-        userMod.setKey(userTO.getKey());
-        userMod.getMembershipsToAdd().add(membershipMod);
-        userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
-
-        userTO = updateUser(userMod);
-        assertNotNull(userTO);
-        // ----------------------------------
-
-        // change attribute value directly on resource
-        final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
-
-        String value = jdbcTemplate.queryForObject(
-                "SELECT EMAIL FROM testsync WHERE ID=?", String.class, userTO.getKey());
-        assertEquals("syncope458_NEW@syncope.apache.org", value);
-
-        jdbcTemplate.update("UPDATE testsync set EMAIL='syncope458_NEW_TWO@syncope.apache.org' WHERE ID=?", userTO.
-                getKey());
-
-        value = jdbcTemplate.queryForObject("SELECT EMAIL FROM testsync WHERE ID=?", String.class, userTO.getKey());
-        assertEquals("syncope458_NEW_TWO@syncope.apache.org", value);
-        // ----------------------------------------
-
-        // ----------------------------------------
-        // restore connector
-        // ----------------------------------------
-        for (ConnConfProperty prop : connInstanceBean.getConfiguration()) {
-            if ("jdbcUrlTemplate".equals(prop.getSchema().getName())) {
-                prop.getValues().clear();
-                prop.getValues().add(jdbcURL);
-            }
-        }
-        connectorService.update(connInstanceBean.getKey(), connInstanceBean);
-        // ----------------------------------------
-
-        userTO = userService.read(userTO.getKey());
-        assertNotNull(userTO);
-        // 4. check virtual attribute synchronization after direct update on resource
-        assertEquals("syncope458_NEW_TWO@syncope.apache.org", userTO.getMemberships().get(0).getVirAttrMap().get(
-                "mvirtualdata").getValues().get(0));
-
-        // 5. remove membership virtual attribute
-        membershipMod = new MembershipMod();
-        membershipMod.setGroup(groupTO.getKey());
-        membershipMod.getVirAttrsToRemove().add("mvirtualdata");
-
-        userMod = new UserMod();
-        userMod.setKey(userTO.getKey());
-        userMod.getMembershipsToAdd().add(membershipMod);
-        userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
-
-        userTO = updateUser(userMod);
-        assertNotNull(userTO);
-        // check again after update if membership hasn't any virtual attribute
-        assertTrue(userTO.getMemberships().get(0).getVirAttrMap().isEmpty());
-
-        // -------------------------------------------
-        // Delete group ad-hoc and restore resource mapping
-        // -------------------------------------------
-        groupService.delete(groupTO.getKey());
-
-        resourceUMapping.removeItem(item);
-        resourceDBVirAttr.setUmapping(resourceUMapping);
-        resourceService.update(RESOURCE_NAME_DBVIRATTR, resourceDBVirAttr);
-        // -------------------------------------------
-    }
-
-    @Test
     public void issueSYNCOPE501() {
-        // PHASE 1: update only user virtual attributes
-
         // 1. create user and propagate him on resource-db-virattr
         UserTO userTO = UserITCase.getUniqueSampleTO("syncope501@apache.org");
         userTO.getResources().clear();
@@ -771,102 +607,5 @@ public class VirAttrITCase extends AbstractITCase {
         // 3. check that user virtual attribute has really been updated 
         assertFalse(userTO.getVirAttrMap().get("virtualdata").getValues().isEmpty());
         assertEquals("syncope501_updated@apache.org", userTO.getVirAttrMap().get("virtualdata").getValues().get(0));
-
-        // ----------------------------------------------------------
-        // PHASE 2: update only membership virtual attributes
-        // -------------------------------------------
-        // Update resource-db-virattr mapping adding new membership virtual schema mapping
-        // -------------------------------------------
-        ResourceTO resourceDBVirAttr = resourceService.read(RESOURCE_NAME_DBVIRATTR);
-        assertNotNull(resourceDBVirAttr);
-
-        final MappingTO resourceUMapping = resourceDBVirAttr.getUmapping();
-
-        MappingItemTO item = new MappingItemTO();
-        item.setIntAttrName("mvirtualdata");
-        item.setIntMappingType(IntMappingType.MembershipVirtualSchema);
-        item.setExtAttrName("EMAIL");
-        item.setPurpose(MappingPurpose.BOTH);
-
-        resourceUMapping.addItem(item);
-
-        resourceDBVirAttr.setUmapping(resourceUMapping);
-
-        resourceService.update(RESOURCE_NAME_DBVIRATTR, resourceDBVirAttr);
-        // -------------------------------------------
-
-        // -------------------------------------------
-        // Create a group ad-hoc
-        // -------------------------------------------
-        final String groupName = "issueSYNCOPE501-Group-" + getUUIDString();
-        GroupTO groupTO = new GroupTO();
-        groupTO.setName(groupName);
-        groupTO.setRealm("/");
-        groupTO.getMVirAttrTemplates().add("mvirtualdata");
-        groupTO = createGroup(groupTO);
-        // -------------------------------------------
-
-        // 1. add membership, with virtual attribute populated, to user
-        MembershipMod membershipMod = new MembershipMod();
-        membershipMod.setGroup(groupTO.getKey());
-        membershipMod.getVirAttrsToUpdate().add(attrMod("mvirtualdata", "syncope501membership@test.org"));
-
-        userMod = new UserMod();
-        userMod.setKey(userTO.getKey());
-        userMod.getMembershipsToAdd().add(membershipMod);
-        userMod.setPwdPropRequest(statusMod);
-
-        userTO = updateUser(userMod);
-        assertNotNull(userTO);
-        assertEquals("syncope501membership@test.org",
-                userTO.getMemberships().get(0).getVirAttrMap().get("mvirtualdata").getValues().get(0));
-
-        // 2. update only membership virtual attribute and propagate user
-        membershipMod = new MembershipMod();
-        membershipMod.setGroup(groupTO.getKey());
-        membershipMod.getVirAttrsToUpdate().add(attrMod("mvirtualdata",
-                "syncope501membership_updated@test.org"));
-        membershipMod.getVirAttrsToRemove().add("syncope501membership@test.org");
-
-        userMod = new UserMod();
-        userMod.setKey(userTO.getKey());
-        userMod.getMembershipsToAdd().add(membershipMod);
-        userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
-        userMod.setPwdPropRequest(statusMod);
-
-        userTO = updateUser(userMod);
-        assertNotNull(userTO);
-
-        // 3. check if change has been propagated
-        assertEquals("syncope501membership_updated@test.org", userTO.getMemberships().get(0).getVirAttrMap().
-                get("mvirtualdata").getValues().get(0));
-
-        // 4. delete membership and check on resource attribute deletion
-        userMod = new UserMod();
-        userMod.setKey(userTO.getKey());
-        userMod.getMembershipsToRemove().add(userTO.getMemberships().get(0).getKey());
-        userMod.setPwdPropRequest(statusMod);
-
-        userTO = updateUser(userMod);
-        assertNotNull(userTO);
-        assertTrue(userTO.getMemberships().isEmpty());
-
-        // read attribute value directly on resource
-        final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
-
-        final String emailValue = jdbcTemplate.queryForObject(
-                "SELECT EMAIL FROM testsync WHERE ID=?", String.class, userTO.getKey());
-        assertTrue(StringUtils.isBlank(emailValue));
-        // ----------------------------------------
-
-        // -------------------------------------------
-        // Delete group ad-hoc and restore resource mapping
-        // -------------------------------------------
-        groupService.delete(groupTO.getKey());
-
-        resourceUMapping.removeItem(item);
-        resourceDBVirAttr.setUmapping(resourceUMapping);
-        resourceService.update(RESOURCE_NAME_DBVIRATTR, resourceDBVirAttr);
-        // -------------------------------------------
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirSchemaITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirSchemaITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirSchemaITCase.java
index c8259f0..a1ee34d 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirSchemaITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirSchemaITCase.java
@@ -28,7 +28,6 @@ import java.util.List;
 import javax.ws.rs.core.Response;
 import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.VirSchemaTO;
-import org.apache.syncope.common.lib.types.AttributableType;
 import org.apache.syncope.common.lib.types.ClientExceptionType;
 import org.apache.syncope.common.lib.types.EntityViolationType;
 import org.apache.syncope.common.lib.types.SchemaType;
@@ -41,7 +40,7 @@ public class VirSchemaITCase extends AbstractITCase {
 
     @Test
     public void list() {
-        List<VirSchemaTO> vSchemas = schemaService.list(AttributableType.USER, SchemaType.VIRTUAL);
+        List<VirSchemaTO> vSchemas = schemaService.list(SchemaType.VIRTUAL);
         assertFalse(vSchemas.isEmpty());
         for (VirSchemaTO vSchemaTO : vSchemas) {
             assertNotNull(vSchemaTO);
@@ -50,8 +49,7 @@ public class VirSchemaITCase extends AbstractITCase {
 
     @Test
     public void read() {
-        VirSchemaTO vSchemaTO = schemaService.read(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL,
-                "mvirtualdata");
+        VirSchemaTO vSchemaTO = schemaService.read(SchemaType.VIRTUAL, "mvirtualdata");
         assertNotNull(vSchemaTO);
     }
 
@@ -60,22 +58,22 @@ public class VirSchemaITCase extends AbstractITCase {
         VirSchemaTO schema = new VirSchemaTO();
         schema.setKey("virtual");
 
-        VirSchemaTO actual = createSchema(AttributableType.USER, SchemaType.VIRTUAL, schema);
+        VirSchemaTO actual = createSchema(SchemaType.VIRTUAL, schema);
         assertNotNull(actual);
 
-        actual = schemaService.read(AttributableType.USER, SchemaType.VIRTUAL, actual.getKey());
+        actual = schemaService.read(SchemaType.VIRTUAL, actual.getKey());
         assertNotNull(actual);
     }
 
     @Test
     public void delete() {
-        VirSchemaTO schema = schemaService.read(AttributableType.GROUP, SchemaType.VIRTUAL, "rvirtualdata");
+        VirSchemaTO schema = schemaService.read(SchemaType.VIRTUAL, "rvirtualdata");
         assertNotNull(schema);
 
-        schemaService.delete(AttributableType.GROUP, SchemaType.VIRTUAL, schema.getKey());
+        schemaService.delete(SchemaType.VIRTUAL, schema.getKey());
 
         try {
-            schemaService.read(AttributableType.GROUP, SchemaType.VIRTUAL, "rvirtualdata");
+            schemaService.read(SchemaType.VIRTUAL, "rvirtualdata");
             fail();
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.NotFound, e.getType());
@@ -84,11 +82,11 @@ public class VirSchemaITCase extends AbstractITCase {
 
     @Test
     public void issueSYNCOPE323() {
-        VirSchemaTO actual = schemaService.read(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL, "mvirtualdata");
+        VirSchemaTO actual = schemaService.read(SchemaType.VIRTUAL, "mvirtualdata");
         assertNotNull(actual);
 
         try {
-            createSchema(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL, actual);
+            createSchema(SchemaType.VIRTUAL, actual);
             fail();
         } catch (SyncopeClientException e) {
             assertEquals(Response.Status.CONFLICT, e.getType().getResponseStatus());
@@ -97,7 +95,7 @@ public class VirSchemaITCase extends AbstractITCase {
 
         actual.setKey(null);
         try {
-            createSchema(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL, actual);
+            createSchema(SchemaType.VIRTUAL, actual);
             fail();
         } catch (SyncopeClientException e) {
             assertEquals(Response.Status.BAD_REQUEST, e.getType().getResponseStatus());
@@ -111,7 +109,7 @@ public class VirSchemaITCase extends AbstractITCase {
         schema.setKey("http://schemas.examples.org/security/authorization/organizationUnit");
 
         try {
-            createSchema(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL, schema);
+            createSchema(SchemaType.VIRTUAL, schema);
             fail();
         } catch (SyncopeClientException e) {
             assertEquals(ClientExceptionType.InvalidVirSchema, e.getType());

http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/WorkflowITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/WorkflowITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/WorkflowITCase.java
index 106b1f1..9c9dd06 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/WorkflowITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/WorkflowITCase.java
@@ -26,13 +26,13 @@ import java.io.IOException;
 import java.io.InputStream;
 import javax.ws.rs.core.Response;
 import org.apache.commons.io.IOUtils;
-import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.junit.Assume;
 import org.junit.Test;
 
 public class WorkflowITCase extends AbstractITCase {
 
-    private void exportDefinition(final SubjectType type) throws IOException {
+    private void exportDefinition(final AnyTypeKind type) throws IOException {
         Response response = workflowService.exportDefinition(type);
         assertTrue(response.getMediaType().toString().
                 startsWith(clientFactory.getContentType().getMediaType().toString()));
@@ -45,16 +45,16 @@ public class WorkflowITCase extends AbstractITCase {
     @Test
     public void exportUserDefinition() throws IOException {
         Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
-        exportDefinition(SubjectType.USER);
+        exportDefinition(AnyTypeKind.USER);
     }
 
     @Test
     public void getGroupDefinition() throws IOException {
         Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForGroups(syncopeService));
-        exportDefinition(SubjectType.GROUP);
+        exportDefinition(AnyTypeKind.GROUP);
     }
 
-    private void importDefinition(final SubjectType type) throws IOException {
+    private void importDefinition(final AnyTypeKind type) throws IOException {
         Response response = workflowService.exportDefinition(type);
         String definition = IOUtils.toString((InputStream) response.getEntity());
 
@@ -64,12 +64,12 @@ public class WorkflowITCase extends AbstractITCase {
     @Test
     public void updateUserDefinition() throws IOException {
         Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
-        importDefinition(SubjectType.USER);
+        importDefinition(AnyTypeKind.USER);
     }
 
     @Test
     public void updateGroupDefinition() throws IOException {
         Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForGroups(syncopeService));
-        importDefinition(SubjectType.GROUP);
+        importDefinition(AnyTypeKind.GROUP);
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5253fd0..e1bdf65 100644
--- a/pom.xml
+++ b/pom.xml
@@ -378,7 +378,7 @@ under the License.
     <font-awesome.version>4.3.0</font-awesome.version>
     <ionicons.version>2.0.1</ionicons.version>
     <highlightjs.version>8.4-4</highlightjs.version>
-    <codemirror.version>5.1</codemirror.version>
+    <codemirror.version>5.3</codemirror.version>
     
     <wicket.version>7.0.0-M5</wicket.version>
     <wicket-jqueryui.version>7.0.0-M5</wicket-jqueryui.version>


Mime
View raw message