diff --git a/packaging/tests/tas-restapi/src/main/java/org/alfresco/rest/model/RestGroupsModel.java b/packaging/tests/tas-restapi/src/main/java/org/alfresco/rest/model/RestGroupsModel.java index ec8c28b1058..d8a9b975b23 100644 --- a/packaging/tests/tas-restapi/src/main/java/org/alfresco/rest/model/RestGroupsModel.java +++ b/packaging/tests/tas-restapi/src/main/java/org/alfresco/rest/model/RestGroupsModel.java @@ -38,8 +38,12 @@ public class RestGroupsModel extends TestModel implements IRestModel parentIds; @@ -75,6 +79,22 @@ public void setDisplayName(String displayName) this.displayName = displayName; } + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Boolean getHasSubgroups() { + return hasSubgroups; + } + + public void setHasSubgroups(Boolean hasSubgroups) { + this.hasSubgroups = hasSubgroups; + } + public Boolean getIsRoot() { return isRoot; diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/groups/GroupsTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/groups/GroupsTests.java index 1ea3b53166a..90a42fc3f2a 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/groups/GroupsTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/groups/GroupsTests.java @@ -34,7 +34,8 @@ public void dataPreparation() throws Exception public void createListUpdateAndDeleteGroup() throws Exception { String groupName = "ZtestGroup" + UUID.randomUUID().toString(); - JsonObject groupBody = Json.createObjectBuilder().add("id", groupName).add("displayName", groupName).build(); + String groupDescription = "ZtestGroup description" + UUID.randomUUID().toString(); + JsonObject groupBody = Json.createObjectBuilder().add("id", groupName).add("displayName", groupName).add("description", groupDescription).build(); String groupBodyCreate = groupBody.toString(); //GroupCreation: @@ -45,7 +46,9 @@ public void createListUpdateAndDeleteGroup() throws Exception restClient.authenticateUser(adminUser).withCoreAPI().usingParams("include=zones").usingGroups().createGroup(groupBodyCreate) .assertThat().field("zones").contains("APP.DEFAULT") .and().field("isRoot").is(true) - .and().field("displayName").is(groupName); + .and().field("displayName").is(groupName) + .and().field("description").is(groupDescription) + .and().field("hasSubgroups").is(false); restClient.assertStatusCodeIs(HttpStatus.CREATED); //ListGroups: @@ -55,11 +58,12 @@ public void createListUpdateAndDeleteGroup() throws Exception .and().paginationField("maxItems").is("10"); restClient.assertStatusCodeIs(HttpStatus.OK); - groupBody = Json.createObjectBuilder().add("displayName", "Z"+groupName).build(); + groupBody = Json.createObjectBuilder().add("displayName", "Z"+groupName).add("description", "Z"+groupDescription).build(); String groupBodyUpdate = groupBody.toString(); //UpdateGroup: restClient.withCoreAPI().usingGroups().updateGroupDetails("GROUP_"+groupName, groupBodyUpdate) .assertThat().field("displayName").is("Z"+groupName) + .and().field("description").is("Z"+groupDescription) .and().field("id").is("GROUP_"+groupName) .and().field("zones").isNull(); restClient.assertStatusCodeIs(HttpStatus.OK); @@ -68,7 +72,8 @@ public void createListUpdateAndDeleteGroup() throws Exception restClient.withCoreAPI().usingParams("include=zones").usingGroups().getGroupDetail("GROUP_"+groupName) .assertThat().field("id").is("GROUP_"+groupName) .and().field("zones").contains("APP.DEFAULT") - .and().field("isRoot").is(true); + .and().field("isRoot").is(true) + .and().field("hasSubgroups").is(false); restClient.assertStatusCodeIs(HttpStatus.OK); //DeleteGroup: @@ -86,15 +91,23 @@ public void createListUpdateAndDeleteGroup() throws Exception public void createListDeleteGroupMembership() throws Exception { String groupName = "ZtestGroup" + UUID.randomUUID().toString(); + String subGroupName = "ZtestSubgroup" + UUID.randomUUID().toString(); JsonObject groupBody = Json.createObjectBuilder().add("id", groupName).add("displayName", groupName).build(); + JsonObject subgroupBody = Json.createObjectBuilder().add("id", subGroupName).add("displayName", subGroupName).build(); String groupBodyCreate = groupBody.toString(); + String subgroupBodyCreate = subgroupBody.toString(); //GroupCreation: restClient.authenticateUser(adminUser).withCoreAPI().usingParams("include=zones").usingGroups().createGroup(groupBodyCreate); restClient.assertStatusCodeIs(HttpStatus.CREATED); + restClient.authenticateUser(adminUser).withCoreAPI().usingParams("include=zones").usingGroups().createGroup(subgroupBodyCreate); + restClient.assertStatusCodeIs(HttpStatus.CREATED); JsonObject groupMembershipBody = Json.createObjectBuilder().add("id", userModel.getUsername()).add("memberType", "PERSON").build(); String groupMembershipBodyCreate = groupMembershipBody.toString(); + JsonObject groupMembershipGroupBody = Json.createObjectBuilder().add("id", subGroupName).add("memberType", "GROUP").build(); + String groupMembershipGroupBodyCreate = groupMembershipGroupBody.toString(); + //MembershipCreation: //-ve restClient.authenticateUser(userModel).withCoreAPI().usingGroups().createGroupMembership("GROUP_"+groupName, groupMembershipBodyCreate); @@ -102,10 +115,19 @@ public void createListDeleteGroupMembership() throws Exception //+ve restClient.authenticateUser(adminUser).withCoreAPI().usingGroups().createGroupMembership("GROUP_"+groupName, groupMembershipBodyCreate); restClient.assertStatusCodeIs(HttpStatus.CREATED); + restClient.authenticateUser(adminUser).withCoreAPI().usingGroups().createGroupMembership("GROUP_"+groupName, groupMembershipGroupBodyCreate); + restClient.assertStatusCodeIs(HttpStatus.CREATED); //ListPersonMembership 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); + + //CheckListDetails + restClient.withCoreAPI().usingParams("include=zones").usingGroups().getGroupDetail("GROUP_"+groupName) + .assertThat().field("id").is("GROUP_"+groupName) + .and().field("hasSubgroups").is(true); restClient.assertStatusCodeIs(HttpStatus.OK); //DeleteGroupMembership diff --git a/remote-api/src/main/java/org/alfresco/rest/api/impl/GroupsImpl.java b/remote-api/src/main/java/org/alfresco/rest/api/impl/GroupsImpl.java index 784de7be2bd..865ceb93f6f 100644 --- a/remote-api/src/main/java/org/alfresco/rest/api/impl/GroupsImpl.java +++ b/remote-api/src/main/java/org/alfresco/rest/api/impl/GroupsImpl.java @@ -51,9 +51,11 @@ import org.alfresco.repo.security.authority.UnknownAuthorityException; import org.alfresco.rest.antlr.WhereClauseParser; import org.alfresco.rest.api.Groups; +import org.alfresco.rest.api.Nodes; import org.alfresco.rest.api.People; import org.alfresco.rest.api.model.Group; import org.alfresco.rest.api.model.GroupMember; +import org.alfresco.rest.api.model.Node; import org.alfresco.rest.framework.core.exceptions.ConstraintViolatedException; import org.alfresco.rest.framework.core.exceptions.EntityNotFoundException; import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException; @@ -68,6 +70,7 @@ import org.alfresco.rest.framework.resource.parameters.where.QueryHelper; import org.alfresco.rest.workflow.api.impl.MapBasedQueryWalker; import org.alfresco.rest.workflow.api.impl.MapBasedQueryWalkerOrSupported; +import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.security.AuthorityService; import org.alfresco.service.cmr.security.AuthorityType; import org.alfresco.service.cmr.security.PermissionService; @@ -109,6 +112,7 @@ public class GroupsImpl implements Groups private AuthorityDAO authorityDAO; protected People people; + protected Nodes nodes; public AuthorityService getAuthorityService() { @@ -130,6 +134,10 @@ public void setPeople(People people) this.people = people; } + public void setNodes(Nodes nodes) { + this.nodes = nodes; + } + public Group create(Group group, Parameters parameters) { validateGroup(group, false); @@ -151,6 +159,17 @@ public Group create(Group group, Parameters parameters) authorityService.addAuthority(group.getParentIds(), authority); } + if (group.getDescription() != null && !group.getDescription().isEmpty()) + { + NodeRef groupNodeRef = authorityService.getAuthorityNodeRef(authorityDisplayName); + Node groupNode = nodes.getNode(groupNodeRef.getId()); + Map props = groupNode.getProperties(); + if (props != null) + { + props.put("cm:description", group.getDescription()); + } + } + return getGroup(authority, parameters); } @@ -168,6 +187,17 @@ public Group update(String groupId, Group group, Parameters parameters) handleAuthorityException(ae); } + if (group.getDescription() != null && !group.getDescription().isEmpty()) + { + NodeRef groupNodeRef = authorityService.getAuthorityNodeRef(group.getDisplayName()); + Node groupNode = nodes.getNode(groupNodeRef.getId()); + Map props = groupNode.getProperties(); + if (props != null) + { + props.put("cm:description", group.getDescription()); + } + } + return getGroup(groupId, parameters); } @@ -584,6 +614,17 @@ private Group getGroup(AuthorityInfo authorityInfo, List includeParam, S group.setDisplayName(authorityDisplayName); group.setIsRoot(isRootAuthority(rootAuthorities, authorityInfo.getAuthorityName())); + group.setHasSubgroups(!authorityService.getContainedAuthorities(AuthorityType.GROUP, authorityInfo.getAuthorityName(), true).isEmpty()); + + NodeRef groupNodeRef = authorityService.getAuthorityNodeRef(authorityDisplayName); + Node groupNode = nodes.getNode(groupNodeRef.getId()); + Map props = groupNode.getProperties(); + String description = ""; + if (props != null) + { + description = props.get("cm:description") != null ? (String) props.get("cm:description") : ""; + } + group.setDescription(description); // Optionally include if (includeParam != null) @@ -1014,6 +1055,10 @@ private void validateGroup(Group group, boolean isUpdate) { throw new InvalidArgumentException("Group update does not support field: zones"); } + if (group.wasSet(Group.HAS_SUBGROUPS)) + { + throw new InvalidArgumentException("Group update does not support field: hasSubgroups"); + } } } diff --git a/remote-api/src/main/java/org/alfresco/rest/api/model/Group.java b/remote-api/src/main/java/org/alfresco/rest/api/model/Group.java index 6ef826229cf..8b4a3647514 100644 --- a/remote-api/src/main/java/org/alfresco/rest/api/model/Group.java +++ b/remote-api/src/main/java/org/alfresco/rest/api/model/Group.java @@ -42,7 +42,9 @@ public class Group implements Comparable protected String id; // group id (aka authority name) protected String displayName; + protected String description; protected Boolean isRoot; + protected Boolean hasSubgroups; protected Set parentIds; protected Set zones; @@ -50,7 +52,9 @@ public class Group implements Comparable public static final String ID = "id"; public static final String DISPLAY_NAME = "displayName"; + public static final String DESCRIPTION = "description"; public static final String IS_ROOT = "isRoot"; + public static final String HAS_SUBGROUPS = "hasSubgroups"; public static final String PARENT_IDS = "parentIds"; public static final String ZONES = "zones"; @@ -81,6 +85,14 @@ public void setDisplayName(String displayName) setFields.put(DISPLAY_NAME, true); } + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + public Boolean getIsRoot() { return isRoot; @@ -92,6 +104,14 @@ public void setIsRoot(Boolean isRoot) setFields.put(IS_ROOT, true); } + public Boolean getHasSubgroups() { + return hasSubgroups; + } + + public void setHasSubgroups(Boolean hasSubgroups) { + this.hasSubgroups = hasSubgroups; + } + public Set getParentIds() { return parentIds; @@ -154,7 +174,8 @@ public int hashCode() @Override public String toString() { - return "Group [id=" + id + ", displayName=" + displayName + ", isRoot=" + isRoot + "]"; + return "Group [id=" + id + ", displayName=" + displayName + ", description=" + description + + ", isRoot=" + isRoot + ", hasSubgroups=" + hasSubgroups + "]"; } public boolean wasSet(String fieldName) diff --git a/remote-api/src/main/resources/alfresco/public-rest-context.xml b/remote-api/src/main/resources/alfresco/public-rest-context.xml index d562e174bf0..eae02df1dc0 100644 --- a/remote-api/src/main/resources/alfresco/public-rest-context.xml +++ b/remote-api/src/main/resources/alfresco/public-rest-context.xml @@ -1692,6 +1692,7 @@ + diff --git a/remote-api/src/test/java/org/alfresco/repo/web/scripts/groups/GroupsTest.java b/remote-api/src/test/java/org/alfresco/repo/web/scripts/groups/GroupsTest.java index 9e2a2e58650..9c15689c0e9 100644 --- a/remote-api/src/test/java/org/alfresco/repo/web/scripts/groups/GroupsTest.java +++ b/remote-api/src/test/java/org/alfresco/repo/web/scripts/groups/GroupsTest.java @@ -1,28 +1,28 @@ -/* - * #%L - * Alfresco Remote API - * %% - * Copyright (C) 2005 - 2016 Alfresco Software Limited - * %% - * This file is part of the Alfresco software. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - * #L% - */ +/* + * #%L + * Alfresco Remote API + * %% + * Copyright (C) 2005 - 2016 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ package org.alfresco.repo.web.scripts.groups; @@ -229,7 +229,8 @@ public void testGetRootGroup() throws Exception assertEquals("shortName wrong", TEST_ROOTGROUP, rootGroup.getString("shortName")); assertEquals("displayName wrong", TEST_ROOTGROUP_DISPLAY_NAME, rootGroup.getString("displayName")); assertEquals("authorityType wrong", "GROUP", rootGroup.getString("authorityType")); - gotRootGroup = true; + assertEquals("hasSubgroups wrong", true, rootGroup.getString("hasSubgroups")); + gotRootGroup = true; } if(rootGroup.getString("shortName").equals(EMAIL_GROUP)) { @@ -270,7 +271,8 @@ public void testGetRootGroup() throws Exception assertEquals("shortName wrong", TEST_ROOTGROUP, rootGroup.getString("shortName")); assertEquals("displayName wrong", TEST_ROOTGROUP_DISPLAY_NAME, rootGroup.getString("displayName")); assertEquals("authorityType wrong", "GROUP", rootGroup.getString("authorityType")); - } + assertEquals("hasSubgroups wrong", true, rootGroup.getString("hasSubgroups")); + } } } @@ -293,7 +295,8 @@ public void testGetRootGroup() throws Exception assertEquals("shortName wrong", TEST_ROOTGROUP, rootGroup.getString("shortName")); assertEquals("displayName wrong", TEST_ROOTGROUP_DISPLAY_NAME, rootGroup.getString("displayName")); assertEquals("authorityType wrong", "GROUP", rootGroup.getString("authorityType")); - } + assertEquals("hasSubgroups wrong", true, rootGroup.getString("hasSubgroups")); + } } } @@ -382,12 +385,14 @@ public void testCreateRootGroup() throws Exception */ { JSONObject newGroupJSON = new JSONObject(); - newGroupJSON.put("displayName", myDisplayName); + newGroupJSON.put("displayName", myDisplayName); + newGroupJSON.put("description", "testDesc"); Response response = sendRequest(new PostRequest(URL_ROOTGROUPS + "/" + myGroupName, newGroupJSON.toString(), "application/json"), Status.STATUS_CREATED); JSONObject top = new JSONObject(response.getContentAsString()); JSONObject rootGroup = top.getJSONObject("data"); assertEquals("shortName wrong", myGroupName, rootGroup.getString("shortName")); assertEquals("displayName wrong", myDisplayName, rootGroup.getString("displayName")); + assertEquals("description wrong", "testDesc", rootGroup.getString("description")); } /** @@ -502,7 +507,18 @@ public void testLinkChild() throws Exception assertEquals("shortName wrong", TEST_LINK, subGroup.getString("shortName")); assertEquals("authorityType wrong", "GROUP", subGroup.getString("authorityType")); } - + + /** + * Check if myGroup has subgroups + */ + { + Response response = sendRequest(new GetRequest(URL_GROUPS + "/" + myRootGroup), Status.STATUS_OK); + JSONObject top = new JSONObject(response.getContentAsString()); + logger.debug(response.getContentAsString()); + JSONObject myGroup = top.getJSONObject("data"); + assertTrue(myGroup.getBoolean("hasSubgroups")); + } + /** * Now link in an existing user */ @@ -555,6 +571,17 @@ public void testLinkChild() throws Exception //assertTrue("group B not removed", data.length() == 0); } + + /** + * Check if myGroup has no subgroups + */ + { + Response response = sendRequest(new GetRequest(URL_GROUPS + "/" + myRootGroup), Status.STATUS_OK); + JSONObject top = new JSONObject(response.getContentAsString()); + logger.debug(response.getContentAsString()); + JSONObject myGroup = top.getJSONObject("data"); + assertFalse(myGroup.getBoolean("hasSubgroups")); + } /** * Create a new group (BUFFY) @@ -613,19 +640,22 @@ public void testUpdateGroup() throws Exception { String myGroupName = "GT_UG"; String myDisplayName = "GT_UGDisplay"; + String description = "GT_UGDesc"; String myNewDisplayName = "GT_UGDisplayNew"; - - this.authenticationComponent.setSystemUserAsCurrentUser(); + String newDescription = "GT_UGDescNew"; + + this.authenticationComponent.setSystemUserAsCurrentUser(); try { /** - * Create a root group + * Create a root group with descrription */ { JSONObject newGroupJSON = new JSONObject(); - newGroupJSON.put("displayName", myDisplayName); - sendRequest(new PostRequest(URL_ROOTGROUPS + "/" + myGroupName, newGroupJSON.toString(), "application/json"), Status.STATUS_CREATED); + newGroupJSON.put("displayName", myDisplayName); + newGroupJSON.put("description", description); + sendRequest(new PostRequest(URL_ROOTGROUPS + "/" + myGroupName, newGroupJSON.toString(), "application/json"), Status.STATUS_CREATED); } /** @@ -633,14 +663,15 @@ public void testUpdateGroup() throws Exception */ { JSONObject newGroupJSON = new JSONObject(); - newGroupJSON.put("displayName", myNewDisplayName); - Response response = sendRequest(new PutRequest(URL_GROUPS + "/" + myGroupName, newGroupJSON.toString(), "application/json"), Status.STATUS_OK); + newGroupJSON.put("displayName", myNewDisplayName); + newGroupJSON.put("description", newDescription); + Response response = sendRequest(new PutRequest(URL_GROUPS + "/" + myGroupName, newGroupJSON.toString(), "application/json"), Status.STATUS_OK); JSONObject top = new JSONObject(response.getContentAsString()); logger.debug(response.getContentAsString()); JSONObject data = top.getJSONObject("data"); assertTrue(data.length() > 0); assertEquals("displayName wrong", myNewDisplayName, data.getString("displayName")); - + assertEquals("description wrong", newDescription, data.getString("description")); } /** @@ -653,7 +684,7 @@ public void testUpdateGroup() throws Exception JSONObject data = top.getJSONObject("data"); assertTrue(data.length() > 0); assertEquals("displayName wrong", myNewDisplayName, data.getString("displayName")); - + assertEquals("description wrong", newDescription, data.getString("description")); } /** diff --git a/remote-api/src/test/java/org/alfresco/rest/api/tests/GroupsTest.java b/remote-api/src/test/java/org/alfresco/rest/api/tests/GroupsTest.java index 99c57462dd8..cf89affbfdf 100644 --- a/remote-api/src/test/java/org/alfresco/rest/api/tests/GroupsTest.java +++ b/remote-api/src/test/java/org/alfresco/rest/api/tests/GroupsTest.java @@ -43,11 +43,9 @@ import org.alfresco.service.cmr.security.AuthorityType; import org.alfresco.service.cmr.security.PermissionService; import org.alfresco.util.GUID; -import org.alfresco.util.testing.category.LuceneTests; import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.mockito.Mock; import javax.servlet.http.HttpServletResponse; @@ -663,7 +661,9 @@ private void validateGroupDefaultFields(Group group, boolean ignoreOptionallyInc assertNotNull(group); assertNotNull(group.getId()); assertNotNull(group.getDisplayName()); + assertNotNull(group.getDescription()); assertNotNull(group.getIsRoot()); + assertNotNull(group.getHasSubgroups()); if (!ignoreOptionallyIncluded) { @@ -1421,13 +1421,16 @@ public void testCreateGroup() throws Exception otherParams.put("include", org.alfresco.rest.api.Groups.PARAM_INCLUDE_PARENT_IDS); Group group = generateGroup(); + group.setDescription("testDesc"); Group createdGroup01 = groupsProxy.createGroup(group, null, HttpServletResponse.SC_CREATED); assertNotNull(createdGroup01); assertNotNull(createdGroup01.getId()); + assertEquals(createdGroup01.getDescription(), "testDesc"); assertTrue(createdGroup01.getIsRoot()); assertNull(createdGroup01.getParentIds()); + assertFalse(createdGroup01.getHasSubgroups()); Set subGroup01Parents = new HashSet<>(); subGroup01Parents.add(createdGroup01.getId()); @@ -1441,6 +1444,8 @@ public void testCreateGroup() throws Exception assertFalse(createdSubGroup01.getIsRoot()); assertNotNull(createdSubGroup01.getParentIds()); assertEquals(subGroup01Parents, createdSubGroup01.getParentIds()); + assertTrue(createdGroup01.getHasSubgroups()); + assertFalse(createdSubGroup01.getHasSubgroups()); } // Group id is missing. @@ -1623,6 +1628,7 @@ public void testUpdateGroup() throws Exception subGroupParents.add(group.getId()); Group generatedSubGroup = generateGroup(); + generatedSubGroup.setDescription("initialDesc"); generatedSubGroup.setParentIds(subGroupParents); Group subGroup = groupsProxy.createGroup(generatedSubGroup, otherParams, HttpServletResponse.SC_CREATED); @@ -1645,9 +1651,11 @@ public void testUpdateGroup() throws Exception String displayName = "newDisplayName"; + String description = "newDesc"; Group mySubGroup = new Group(); mySubGroup.setDisplayName(displayName); + mySubGroup.setDescription(description); Group updateGroup = groupsProxy.updateGroup(subGroup.getId(), mySubGroup, otherParams, HttpServletResponse.SC_OK); @@ -1657,8 +1665,9 @@ public void testUpdateGroup() throws Exception assertFalse(updateGroup.getIsRoot()); assertNotNull(updateGroup.getParentIds()); - // Check that only display name changed. + // Check that only display name and description changed. assertEquals(displayName, updateGroup.getDisplayName()); + assertEquals(description, updateGroup.getDescription()); // Check that nothing else changed. assertEquals(subGroup.getId(), updateGroup.getId());