ALF-10001 Update SiteService.listMembers to check group display names as well as group names, plus test

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30225 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2011-09-05 14:22:01 +00:00
parent 32b756a7f9
commit f694b1c928
2 changed files with 24 additions and 4 deletions

View File

@@ -87,6 +87,8 @@ public class SiteServiceImplTest extends BaseAlfrescoSpringTest
private static final String GROUP_TWO = "GrpTwo_SiteServiceImplTest";
private static final String GROUP_THREE = "GrpThree_SiteServiceImplTest";
private static final String GROUP_FOUR = "GrpFour_SiteServiceImplTest";
private static final String GROUP_ONE_DISPLAY = "DisplayOfGrpOne-SiteServiceImplTest";
private static final String GROUP_TWO_DISPLAY = "DisplayOfGrpTwo-SiteServiceImplTest";
private CopyService copyService;
private ScriptService scriptService;
@@ -146,10 +148,10 @@ public class SiteServiceImplTest extends BaseAlfrescoSpringTest
createUser(USER_FOUR, "UsRFoUr");
// Create the test groups
this.groupOne = this.authorityService.createAuthority(AuthorityType.GROUP, GROUP_ONE);
this.groupOne = this.authorityService.createAuthority(AuthorityType.GROUP, GROUP_ONE, GROUP_ONE_DISPLAY, null);
this.authorityService.addAuthority(this.groupOne, USER_TWO);
this.groupTwo = this.authorityService.createAuthority(AuthorityType.GROUP, GROUP_TWO);
this.groupTwo = this.authorityService.createAuthority(AuthorityType.GROUP, GROUP_TWO, GROUP_TWO_DISPLAY, null);
this.authorityService.addAuthority(this.groupTwo, USER_TWO);
this.authorityService.addAuthority(this.groupTwo, USER_THREE);
@@ -1323,6 +1325,13 @@ public class SiteServiceImplTest extends BaseAlfrescoSpringTest
assertEquals(1, members.size());
assertTrue(members.containsKey(this.groupTwo));
assertEquals(SiteModel.SITE_CONSUMER, members.get(this.groupTwo));
// - filter by name - group display name
members = this.siteService.listMembers("testMembership", GROUP_TWO_DISPLAY, null, 0, false);
assertNotNull(members);
assertEquals(1, members.size());
assertTrue(members.containsKey(this.groupTwo));
assertEquals(SiteModel.SITE_CONSUMER, members.get(this.groupTwo));
// - filter by name - group name with expansion
// (won't match anyone as the group name won't hit people too)