syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/2] syncope git commit: SYNCOPE-1173 - Replace List<String> dynGroups with List<MembershipTO> dynMemberships
Date Thu, 27 Jul 2017 11:47:35 GMT
Repository: syncope
Updated Branches:
  refs/heads/2_0_X 4a9964872 -> fffee9f15


SYNCOPE-1173 - Replace List<String> dynGroups with List<MembershipTO> dynMemberships


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/025441a3
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/025441a3
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/025441a3

Branch: refs/heads/2_0_X
Commit: 025441a36cf89f02b1b82e0ea617daa27b2ce9ac
Parents: 4a99648
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed Jul 26 16:36:29 2017 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu Jul 27 11:14:22 2017 +0100

----------------------------------------------------------------------
 .../client/console/wizards/any/Groups.java      |  4 +-
 .../syncope/common/lib/to/AnyObjectTO.java      | 12 +++---
 .../common/lib/to/GroupableRelatableTO.java     |  2 +-
 .../apache/syncope/common/lib/to/UserTO.java    | 12 +++---
 .../test/resources/domains/MasterContent.xml    |  8 ++--
 .../java/data/AnyObjectDataBinderImpl.java      | 14 ++++++-
 .../java/data/UserDataBinderImpl.java           | 15 +++++--
 .../apache/syncope/fit/core/GroupITCase.java    | 42 +++++++++++++-------
 .../org/apache/syncope/fit/core/RoleITCase.java |  2 +-
 .../syncope/fit/core/UserIssuesITCase.java      |  5 ++-
 10 files changed, 74 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/025441a3/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Groups.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Groups.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Groups.java
index 8e640fd..499bc26 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Groups.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Groups.java
@@ -313,8 +313,8 @@ public class Groups extends WizardStep implements ICondition {
             GroupFiqlSearchConditionBuilder searchConditionBuilder = SyncopeClient.getGroupSearchConditionBuilder();
 
             ArrayList<CompleteCondition> conditions = new ArrayList<>();
-            for (String groupKey : GroupableRelatableTO.class.cast(anyTO).getDynGroups())
{
-                conditions.add(searchConditionBuilder.is("key").equalTo(groupKey).wrap());
+            for (MembershipTO membership : GroupableRelatableTO.class.cast(anyTO).getDynMemberships())
{
+                conditions.add(searchConditionBuilder.is("key").equalTo(membership.getGroupKey()).wrap());
             }
 
             Map<String, GroupTO> assignedGroups = new HashMap<>();

http://git-wip-us.apache.org/repos/asf/syncope/blob/025441a3/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java
index 231504b..af8b0ea 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java
@@ -41,7 +41,7 @@ public class AnyObjectTO extends AnyTO implements GroupableRelatableTO {
 
     private final List<MembershipTO> memberships = new ArrayList<>();
 
-    private final List<String> dynGroups = new ArrayList<>();
+    private final List<MembershipTO> dynMemberships = new ArrayList<>();
 
     public String getName() {
         return name;
@@ -91,11 +91,11 @@ public class AnyObjectTO extends AnyTO implements GroupableRelatableTO
{
         return memberships;
     }
 
-    @XmlElementWrapper(name = "dynGroups")
-    @XmlElement(name = "role")
-    @JsonProperty("dynGroups")
+    @XmlElementWrapper(name = "dynMemberships")
+    @XmlElement(name = "dynMembership")
+    @JsonProperty("dynMemberships")
     @Override
-    public List<String> getDynGroups() {
-        return dynGroups;
+    public List<MembershipTO> getDynMemberships() {
+        return dynMemberships;
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/025441a3/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupableRelatableTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupableRelatableTO.java
b/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupableRelatableTO.java
index 0dba26d..f2b8dbc 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupableRelatableTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupableRelatableTO.java
@@ -26,7 +26,7 @@ public interface GroupableRelatableTO {
 
     List<MembershipTO> getMemberships();
 
-    List<String> getDynGroups();
+    List<MembershipTO> getDynMemberships();
 
     RelationshipTO getRelationship(String type, String rightKey);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/025441a3/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
index 40ebee5..6deab32 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
@@ -68,7 +68,7 @@ public class UserTO extends AnyTO implements GroupableRelatableTO {
 
     private final List<MembershipTO> memberships = new ArrayList<>();
 
-    private final List<String> dynGroups = new ArrayList<>();
+    private final List<MembershipTO> dynMemberships = new ArrayList<>();
 
     @Override
     public String getType() {
@@ -235,12 +235,12 @@ public class UserTO extends AnyTO implements GroupableRelatableTO {
         return memberships;
     }
 
-    @XmlElementWrapper(name = "dynGroups")
-    @XmlElement(name = "role")
-    @JsonProperty("dynGroups")
+    @XmlElementWrapper(name = "dynMemberships")
+    @XmlElement(name = "dynMembership")
+    @JsonProperty("dynMemberships")
     @Override
-    public List<String> getDynGroups() {
-        return dynGroups;
+    public List<MembershipTO> getDynMemberships() {
+        return dynMemberships;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/025441a3/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
index 0e1598e..59bef19 100644
--- a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
+++ b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
@@ -1167,7 +1167,7 @@ under the License.
         pullMode="INCREMENTAL" unmatchingRule="ASSIGN" matchingRule="UPDATE" active="1"/>
   <AnyTemplatePullTask id="3a6173a9-8c34-4e37-b3b1-0c2ea385fac0"
                        pullTask_id="c41b9b71-9bfa-4f90-89f2-84787def4c5c" anyType_id="USER"
-                       template='{"@class":"org.apache.syncope.common.lib.to.UserTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"USER","realm":null,"status":null,"password":null,"token":null,"tokenExpireTime":null,"username":null,"lastLoginDate":null,"changePwdDate":null,"failedLogins":null,"securityQuestion":null,"securityAnswer":null,"auxClasses":["csv"],"derAttrs":[{"schema":"cn","values":[""]}],"virAttrs":[],"resources":["resource-testdb"],"relationships":[],"memberships":[{"rightType":"GROUP","rightKey":"f779c0d4-633b-4be5-8f57-32eb478a3ca5","groupName":null}],"dynGroups":[],"roles":[],"dynRoles":[],"plainAttrs":[{"schema":"ctype","values":["email
== &apos;test8@syncope.apache.org&apos;? &apos;TYPE_8&apos;: &apos;TYPE_OTHER&apos;"]}]}'/>
+                       template='{"@class":"org.apache.syncope.common.lib.to.UserTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"USER","realm":null,"status":null,"password":null,"token":null,"tokenExpireTime":null,"username":null,"lastLoginDate":null,"changePwdDate":null,"failedLogins":null,"securityQuestion":null,"securityAnswer":null,"auxClasses":["csv"],"derAttrs":[{"schema":"cn","values":[""]}],"virAttrs":[],"resources":["resource-testdb"],"relationships":[],"memberships":[{"rightType":"GROUP","rightKey":"f779c0d4-633b-4be5-8f57-32eb478a3ca5","groupName":null}],"dynMemberships":[],"roles":[],"dynRoles":[],"plainAttrs":[{"schema":"ctype","values":["email
== &apos;test8@syncope.apache.org&apos;? &apos;TYPE_8&apos;: &apos;TYPE_OTHER&apos;"]}]}'/>
   <AnyTemplatePullTask id="b3772d66-ec06-4133-bf38-b3273845ac5b"
                        pullTask_id="c41b9b71-9bfa-4f90-89f2-84787def4c5c" anyType_id="GROUP"
                        template='{"@class":"org.apache.syncope.common.lib.to.GroupTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"GROUP","realm":null,"status":null,"name":null,"userOwner":null,"groupOwner":null,"udynMembershipCond":null,"auxClasses":[],"derAttrs":[],"virAttrs":[],"resources":[],"plainAttrs":[]}'/>
@@ -1186,7 +1186,7 @@ under the License.
         destinationRealm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28" performCreate="1" performUpdate="1"
performDelete="0" syncStatus="1" pullMode="FULL_RECONCILIATION"
         unmatchingRule="PROVISION" matchingRule="UPDATE" active="1"/>
   <AnyTemplatePullTask id="6c3f578d-327b-4a7c-8037-6f5ba24eb770" pullTask_id="83f7e85d-9774-43fe-adba-ccd856312994"
anyType_id="USER"
-                       template='{"@class":"org.apache.syncope.common.lib.to.UserTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"USER","realm":null,"status":null,"password":null,"token":null,"tokenExpireTime":null,"username":null,"lastLoginDate":null,"changePwdDate":null,"failedLogins":null,"securityQuestion":null,"securityAnswer":null,"auxClasses":[],"derAttrs":[],"virAttrs":[],"resources":[],"relationships":[],"memberships":[],"dynGroups":[],"roles":[],"dynRoles":[],"plainAttrs":[{"schema":"ctype","values":["&apos;type
a&apos;"]},{"schema":"userId","values":["&apos;reconciled@syncope.apache.org&apos;"]},{"schema":"fullname","values":["&apos;reconciled
fullname&apos;"]},{"schema":"surname","values":["&apos;surname&apos;"]}]}'/>
+                       template='{"@class":"org.apache.syncope.common.lib.to.UserTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"USER","realm":null,"status":null,"password":null,"token":null,"tokenExpireTime":null,"username":null,"lastLoginDate":null,"changePwdDate":null,"failedLogins":null,"securityQuestion":null,"securityAnswer":null,"auxClasses":[],"derAttrs":[],"virAttrs":[],"resources":[],"relationships":[],"memberships":[],"dynMemberships":[],"roles":[],"dynRoles":[],"plainAttrs":[{"schema":"ctype","values":["&apos;type
a&apos;"]},{"schema":"userId","values":["&apos;reconciled@syncope.apache.org&apos;"]},{"schema":"fullname","values":["&apos;reconciled
fullname&apos;"]},{"schema":"surname","values":["&apos;surname&apos;"]}]}'/>
   <AnyTemplatePullTask id="45b61137-c7c3-49ee-86e0-9efffa75ae68" pullTask_id="83f7e85d-9774-43fe-adba-ccd856312994"
anyType_id="GROUP"
                        template='{"@class":"org.apache.syncope.common.lib.to.GroupTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"GROUP","realm":null,"status":null,"name":null,"userOwner":null,"groupOwner":null,"udynMembershipCond":null,"auxClasses":[],"derAttrs":[],"virAttrs":[],"resources":[],"plainAttrs":[]}'/>
   <Task DTYPE="PullTask" id="81d88f73-d474-4450-9031-605daa4e313f" name="TestDB2 Task"
resource_id="resource-testdb2"
@@ -1199,7 +1199,7 @@ under the License.
         destinationRealm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28" pullMode="FULL_RECONCILIATION"
performCreate="1" performDelete="1" performUpdate="1" syncStatus="0"
         unmatchingRule="PROVISION" matchingRule="UPDATE" active="1"/>
   <AnyTemplatePullTask id="df655a2a-40c0-43b1-a157-3f4988802f58" pullTask_id="1e419ca4-ea81-4493-a14f-28b90113686d"
anyType_id="USER"
-                       template='{"@class":"org.apache.syncope.common.lib.to.UserTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"USER","realm":"&apos;/&apos;
+ title","status":null,"password":null,"token":null,"tokenExpireTime":null,"username":null,"lastLoginDate":null,"changePwdDate":null,"failedLogins":null,"securityQuestion":null,"securityAnswer":null,"auxClasses":["minimal
group"],"derAttrs":[],"virAttrs":[{"schema":"virtualReadOnly","values":[""]}],"resources":["resource-ldap"],"roles":[],"dynRoles":[],"relationships":[],"memberships":[],"dynGroups":[],"plainAttrs":[]}'/>
+                       template='{"@class":"org.apache.syncope.common.lib.to.UserTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"USER","realm":"&apos;/&apos;
+ title","status":null,"password":null,"token":null,"tokenExpireTime":null,"username":null,"lastLoginDate":null,"changePwdDate":null,"failedLogins":null,"securityQuestion":null,"securityAnswer":null,"auxClasses":["minimal
group"],"derAttrs":[],"virAttrs":[{"schema":"virtualReadOnly","values":[""]}],"resources":["resource-ldap"],"roles":[],"dynRoles":[],"relationships":[],"memberships":[],"dynMemberships":[],"plainAttrs":[]}'/>
   <AnyTemplatePullTask id="fda22ff3-98f3-42e4-a2ae-cd9a28282d57" pullTask_id="1e419ca4-ea81-4493-a14f-28b90113686d"
anyType_id="GROUP"
                        template='{"@class":"org.apache.syncope.common.lib.to.GroupTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"GROUP","realm":null,"status":null,"name":null,"userOwner":null,"groupOwner":null,"udynMembershipCond":null,"auxClasses":[],"derAttrs":[],"virAttrs":[],"resources":[],"plainAttrs":[{"schema":"show","values":["true"]}]}'/>
   <PullTask_actionsClassNames pullTask_id="1e419ca4-ea81-4493-a14f-28b90113686d" actionClassName="org.apache.syncope.core.provisioning.java.pushpull.LDAPMembershipPullActions"/>
@@ -1276,7 +1276,7 @@ under the License.
         destinationRealm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28" performCreate="1" performUpdate="1"
performDelete="1" syncStatus="1" pullMode="INCREMENTAL"
         unmatchingRule="PROVISION" matchingRule="UPDATE" active="1"/>
   <AnyTemplatePullTask id="8bc41ba1-cc1d-4ee0-bb43-61cd148b414f" pullTask_id="986867e2-993b-430e-8feb-aa9abb4c1dcd"
anyType_id="USER"
-                       template='{"@class":"org.apache.syncope.common.lib.to.UserTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"USER","realm":null,"status":null,"password":null,"token":null,"tokenExpireTime":null,"username":null,"lastLoginDate":null,"changePwdDate":null,"failedLogins":null,"securityQuestion":null,"securityAnswer":null,"auxClasses":[],"derAttrs":[],"virAttrs":[],"resources":["resource-testdb"],"roles":[],"dynRoles":[],"relationships":[],"memberships":[],"dynGroups":[],"plainAttrs":[{"schema":"firstname","values":[""]},{"schema":"userId","values":["&apos;test&apos;"]},{"schema":"fullname","values":["&apos;test&apos;"]},{"schema":"surname","values":["&apos;test&apos;"]}]}'/>
+                       template='{"@class":"org.apache.syncope.common.lib.to.UserTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"USER","realm":null,"status":null,"password":null,"token":null,"tokenExpireTime":null,"username":null,"lastLoginDate":null,"changePwdDate":null,"failedLogins":null,"securityQuestion":null,"securityAnswer":null,"auxClasses":[],"derAttrs":[],"virAttrs":[],"resources":["resource-testdb"],"roles":[],"dynRoles":[],"relationships":[],"memberships":[],"dynMemberships":[],"plainAttrs":[{"schema":"firstname","values":[""]},{"schema":"userId","values":["&apos;test&apos;"]},{"schema":"fullname","values":["&apos;test&apos;"]},{"schema":"surname","values":["&apos;test&apos;"]}]}'/>
   <AnyTemplatePullTask id="9af0e343-8a37-42d2-9bc7-6e2e3b103219" pullTask_id="986867e2-993b-430e-8feb-aa9abb4c1dcd"
anyType_id="GROUP"
                        template='{"@class":"org.apache.syncope.common.lib.to.GroupTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"GROUP","realm":null,"status":null,"name":null,"userOwner":null,"groupOwner":null,"udynMembershipCond":null,"auxClasses":[],"derAttrs":[],"virAttrs":[],"resources":[],"plainAttrs":[]}'/>
   <Task DTYPE="PullTask" id="feae4e57-15ca-40d9-b973-8b9015efca49" name="CSV (unlink matching;
ignore unmatching)" resource_id="resource-csv"

http://git-wip-us.apache.org/repos/asf/syncope/blob/025441a3/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java
index a2ba7e7..2620718 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java
@@ -69,7 +69,7 @@ import org.springframework.transaction.annotation.Transactional;
 public class AnyObjectDataBinderImpl extends AbstractAnyDataBinder implements AnyObjectDataBinder
{
 
     private static final String[] IGNORE_PROPERTIES = {
-        "type", "realm", "auxClasses", "relationships", "memberships", "dynGroups",
+        "type", "realm", "auxClasses", "relationships", "memberships", "dynMemberships",
         "plainAttrs", "derAttrs", "virAttrs", "resources"
     };
 
@@ -131,7 +131,17 @@ public class AnyObjectDataBinderImpl extends AbstractAnyDataBinder implements
An
 
             // dynamic memberships
             CollectionUtils.collect(anyObjectDAO.findDynGroups(anyObject.getKey()),
-                    EntityUtils.<Group>keyTransformer(), anyObjectTO.getDynGroups());
+                                    new Transformer<Group, MembershipTO>() {
+
+                @Override
+                public MembershipTO transform(final Group group) {
+                    MembershipTO membershipTO = new MembershipTO.Builder().
+                        group(group.getKey(), group.getName()).
+                        build();
+                    return membershipTO;
+
+                }
+            }, anyObjectTO.getDynMemberships());
         }
 
         return anyObjectTO;

http://git-wip-us.apache.org/repos/asf/syncope/blob/025441a3/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
index 38c411b..ed77df4 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
@@ -86,7 +86,7 @@ import org.springframework.transaction.annotation.Transactional;
 public class UserDataBinderImpl extends AbstractAnyDataBinder implements UserDataBinder {
 
     private static final String[] IGNORE_PROPERTIES = {
-        "type", "realm", "auxClasses", "roles", "dynRoles", "relationships", "memberships",
"dynGroups",
+        "type", "realm", "auxClasses", "roles", "dynRoles", "relationships", "memberships",
"dynMemberships",
         "plainAttrs", "derAttrs", "virAttrs", "resources", "securityQuestion", "securityAnswer"
     };
 
@@ -637,8 +637,17 @@ public class UserDataBinderImpl extends AbstractAnyDataBinder implements
UserDat
             // dynamic memberships
             CollectionUtils.collect(userDAO.findDynRoles(user.getKey()),
                     EntityUtils.<Role>keyTransformer(), userTO.getDynRoles());
-            CollectionUtils.collect(userDAO.findDynGroups(user.getKey()),
-                    EntityUtils.<Group>keyTransformer(), userTO.getDynGroups());
+            CollectionUtils.collect(userDAO.findDynGroups(user.getKey()), new Transformer<Group,
MembershipTO>() {
+
+                @Override
+                public MembershipTO transform(final Group group) {
+                    MembershipTO membershipTO = new MembershipTO.Builder().
+                        group(group.getKey(), group.getName()).
+                        build();
+                    return membershipTO;
+
+                }
+            }, userTO.getDynMemberships());
         }
 
         return userTO;

http://git-wip-us.apache.org/repos/asf/syncope/blob/025441a3/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
index f325534..9d833cc 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
@@ -601,7 +601,7 @@ public class GroupITCase extends AbstractITCase {
                 assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
             }
 
-            // 5. also add an actual attribute for badge - it will work        
+            // 5. also add an actual attribute for badge - it will work
             groupPatch.getPlainAttrs().add(attrAddReplacePatch(badge.getKey(), "xxxxxxxxxx"));
 
             groupTO = updateGroup(groupPatch).getEntity();
@@ -642,22 +642,24 @@ public class GroupITCase extends AbstractITCase {
 
     @Test
     public void uDynMembership() {
-        assertTrue(userService.read("c9b2dec2-00a7-4855-97c0-d854842b4b24").getDynGroups().isEmpty());
+        assertTrue(userService.read("c9b2dec2-00a7-4855-97c0-d854842b4b24").getDynMemberships().isEmpty());
 
         GroupTO group = getBasicSampleTO("uDynMembership");
         group.setUDynMembershipCond("cool==true");
         group = createGroup(group).getEntity();
         assertNotNull(group);
+        final String groupKey = group.getKey();
 
-        assertTrue(userService.read(
-                "c9b2dec2-00a7-4855-97c0-d854842b4b24").getDynGroups().contains(group.getKey()));
+        List<MembershipTO> memberships = userService.read(
+            "c9b2dec2-00a7-4855-97c0-d854842b4b24").getDynMemberships();
+        assertTrue(memberships.stream().anyMatch(m -> m.getGroupKey().equals(groupKey)));
 
         GroupPatch patch = new GroupPatch();
         patch.setKey(group.getKey());
         patch.setUDynMembershipCond("cool==false");
         groupService.update(patch);
 
-        assertTrue(userService.read("c9b2dec2-00a7-4855-97c0-d854842b4b24").getDynGroups().isEmpty());
+        assertTrue(userService.read("c9b2dec2-00a7-4855-97c0-d854842b4b24").getDynMemberships().isEmpty());
     }
 
     @Test
@@ -671,6 +673,7 @@ public class GroupITCase extends AbstractITCase {
         assertEquals(fiql, group.getADynMembershipConds().get("PRINTER"));
 
         group = groupService.read(group.getKey());
+        final String groupKey = group.getKey();
         assertEquals(fiql, group.getADynMembershipConds().get("PRINTER"));
 
         // verify that the condition is dynamically applied
@@ -678,11 +681,16 @@ public class GroupITCase extends AbstractITCase {
         newAny.getResources().clear();
         newAny = createAnyObject(newAny).getEntity();
         assertNotNull(newAny.getPlainAttr("location"));
-        assertTrue(anyObjectService.read(
-                "fc6dbc3a-6c07-4965-8781-921e7401a4a5").getDynGroups().contains(group.getKey()));
-        assertTrue(anyObjectService.read(
-                "8559d14d-58c2-46eb-a2d4-a7d35161e8f8").getDynGroups().contains(group.getKey()));
-        assertTrue(anyObjectService.read(newAny.getKey()).getDynGroups().contains(group.getKey()));
+        List<MembershipTO> memberships = anyObjectService.read(
+            "fc6dbc3a-6c07-4965-8781-921e7401a4a5").getDynMemberships();
+        assertTrue(memberships.stream().anyMatch(m -> m.getGroupKey().equals(groupKey)));
+
+        memberships = anyObjectService.read(
+            "8559d14d-58c2-46eb-a2d4-a7d35161e8f8").getDynMemberships();
+        assertTrue(memberships.stream().anyMatch(m -> m.getGroupKey().equals(groupKey)));
+
+        memberships = anyObjectService.read(newAny.getKey()).getDynMemberships();
+        assertTrue(memberships.stream().anyMatch(m -> m.getGroupKey().equals(groupKey)));
 
         // 2. update group and change aDynMembership condition
         fiql = SyncopeClient.getAnyObjectSearchConditionBuilder("PRINTER").is("location").nullValue().query();
@@ -706,11 +714,15 @@ public class GroupITCase extends AbstractITCase {
                 build());
         newAny = updateAnyObject(anyPatch).getEntity();
         assertNull(newAny.getPlainAttr("location"));
-        assertFalse(anyObjectService.read(
-                "fc6dbc3a-6c07-4965-8781-921e7401a4a5").getDynGroups().contains(group.getKey()));
-        assertFalse(anyObjectService.read(
-                "8559d14d-58c2-46eb-a2d4-a7d35161e8f8").getDynGroups().contains(group.getKey()));
-        assertTrue(anyObjectService.read(newAny.getKey()).getDynGroups().contains(group.getKey()));
+
+        memberships = anyObjectService.read(
+            "fc6dbc3a-6c07-4965-8781-921e7401a4a5").getDynMemberships();
+        assertFalse(memberships.stream().anyMatch(m -> m.getGroupKey().equals(groupKey)));
+        memberships = anyObjectService.read(
+            "8559d14d-58c2-46eb-a2d4-a7d35161e8f8").getDynMemberships();
+        assertFalse(memberships.stream().anyMatch(m -> m.getGroupKey().equals(groupKey)));
+        memberships = anyObjectService.read(newAny.getKey()).getDynMemberships();
+        assertTrue(memberships.stream().anyMatch(m -> m.getGroupKey().equals(groupKey)));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/syncope/blob/025441a3/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java
index 62fdde1..fe71fd1 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RoleITCase.java
@@ -136,6 +136,6 @@ public class RoleITCase extends AbstractITCase {
         role.setDynMembershipCond("cool==false");
         roleService.update(role);
 
-        assertTrue(userService.read("c9b2dec2-00a7-4855-97c0-d854842b4b24").getDynGroups().isEmpty());
+        assertTrue(userService.read("c9b2dec2-00a7-4855-97c0-d854842b4b24").getDynMemberships().isEmpty());
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/025441a3/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
index ff0d094..4e7988a 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
@@ -922,7 +922,7 @@ public class UserIssuesITCase extends AbstractITCase {
         assertNotNull(mapItems);
         assertEquals(7, mapItems.size());
 
-        // 3.  update user and check firstname propagation        
+        // 3.  update user and check firstname propagation
         UserPatch userPatch = new UserPatch();
         userPatch.setKey(userTO.getKey());
         userPatch.setPassword(new PasswordPatch());
@@ -1349,7 +1349,8 @@ public class UserIssuesITCase extends AbstractITCase {
 
         // 3. verify that dynamic membership is set and that resource is consequently assigned
         user = created.getEntity();
-        assertTrue(user.getDynGroups().contains(group.getKey()));
+        final String groupKey = group.getKey();
+        assertTrue(user.getDynMemberships().stream().anyMatch(m -> m.getGroupKey().equals(groupKey)));
         assertTrue(user.getResources().contains(RESOURCE_NAME_TESTDB));
 
         // 4. verify that propagation happened towards the resource of the dynamic group


Mime
View raw message