mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
ACS-5506 Proper Group serialization
This commit is contained in:
@@ -120,8 +120,7 @@ public class GroupsTests extends RestTest
|
|||||||
|
|
||||||
//ListPersonMembership
|
//ListPersonMembership
|
||||||
restClient.authenticateUser(userModel).withCoreAPI().usingUser(userModel).listGroupMemberships()
|
restClient.authenticateUser(userModel).withCoreAPI().usingUser(userModel).listGroupMemberships()
|
||||||
.assertThat().entriesListContains("id", "GROUP_"+groupName)
|
.assertThat().entriesListContains("id", "GROUP_"+groupName);
|
||||||
.and().entriesListContains("id", "GROUP_"+subGroupName);
|
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
|
|
||||||
//CheckListDetails
|
//CheckListDetails
|
||||||
|
@@ -58,7 +58,9 @@ public class Group extends org.alfresco.rest.api.model.Group implements Serializ
|
|||||||
|
|
||||||
AssertUtil.assertEquals("id", getId(), other.getId());
|
AssertUtil.assertEquals("id", getId(), other.getId());
|
||||||
AssertUtil.assertEquals("displayName", getDisplayName(), other.getDisplayName());
|
AssertUtil.assertEquals("displayName", getDisplayName(), other.getDisplayName());
|
||||||
|
AssertUtil.assertEquals("description", getDescription(), other.getDescription());
|
||||||
AssertUtil.assertEquals("isRoot", getIsRoot(), other.getIsRoot());
|
AssertUtil.assertEquals("isRoot", getIsRoot(), other.getIsRoot());
|
||||||
|
AssertUtil.assertEquals("hasSubgroups", getHasSubgroups(), other.getHasSubgroups());
|
||||||
AssertUtil.assertEquals("parentIds", getParentIds(), other.getParentIds());
|
AssertUtil.assertEquals("parentIds", getParentIds(), other.getParentIds());
|
||||||
AssertUtil.assertEquals("zones", getZones(), other.getZones());
|
AssertUtil.assertEquals("zones", getZones(), other.getZones());
|
||||||
}
|
}
|
||||||
@@ -73,11 +75,21 @@ public class Group extends org.alfresco.rest.api.model.Group implements Serializ
|
|||||||
|
|
||||||
groupJson.put("displayName", getDisplayName());
|
groupJson.put("displayName", getDisplayName());
|
||||||
|
|
||||||
|
if (getDescription() != null)
|
||||||
|
{
|
||||||
|
groupJson.put("description", getDescription());
|
||||||
|
}
|
||||||
|
|
||||||
if (getIsRoot() != null)
|
if (getIsRoot() != null)
|
||||||
{
|
{
|
||||||
groupJson.put("isRoot", getIsRoot());
|
groupJson.put("isRoot", getIsRoot());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getHasSubgroups() != null)
|
||||||
|
{
|
||||||
|
groupJson.put("hasSubgroups", getHasSubgroups());
|
||||||
|
}
|
||||||
|
|
||||||
if (getParentIds() != null)
|
if (getParentIds() != null)
|
||||||
{
|
{
|
||||||
groupJson.put("parentIds", new ArrayList(getParentIds()));
|
groupJson.put("parentIds", new ArrayList(getParentIds()));
|
||||||
@@ -97,6 +109,7 @@ public class Group extends org.alfresco.rest.api.model.Group implements Serializ
|
|||||||
String displayName = (String) jsonObject.get("displayName");
|
String displayName = (String) jsonObject.get("displayName");
|
||||||
String description = (String) jsonObject.get("description");
|
String description = (String) jsonObject.get("description");
|
||||||
Boolean isRoot = (Boolean) jsonObject.get("isRoot");
|
Boolean isRoot = (Boolean) jsonObject.get("isRoot");
|
||||||
|
Boolean hasSubgroups = (Boolean) jsonObject.get("hasSubgroups");
|
||||||
List<String> parentIds = (List<String>) jsonObject.get("parentIds");
|
List<String> parentIds = (List<String>) jsonObject.get("parentIds");
|
||||||
List<String> zones = (List<String>) jsonObject.get("zones");
|
List<String> zones = (List<String>) jsonObject.get("zones");
|
||||||
|
|
||||||
@@ -105,6 +118,7 @@ public class Group extends org.alfresco.rest.api.model.Group implements Serializ
|
|||||||
group.setDisplayName(displayName);
|
group.setDisplayName(displayName);
|
||||||
group.setDescription(description);
|
group.setDescription(description);
|
||||||
group.setIsRoot(isRoot);
|
group.setIsRoot(isRoot);
|
||||||
|
group.setHasSubgroups(hasSubgroups);
|
||||||
group.setParentIds(parentIds != null ? new HashSet<>(parentIds) : null);
|
group.setParentIds(parentIds != null ? new HashSet<>(parentIds) : null);
|
||||||
group.setZones(zones != null ? new HashSet<>(zones) : null);
|
group.setZones(zones != null ? new HashSet<>(zones) : null);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user