@Override public GeoServerSecurityManager createSecurityManager(MockTestData testData) throws Exception { GeoServerSecurityManager secMgr = createNiceMock(GeoServerSecurityManager.class); GeoServerUserGroupStore ugStore1 = createUserGroupStore("test1", secMgr); addUsers(ugStore1, "user1", "abc"); addGroups(ugStore1, "group1"); GeoServerUserGroupStore ugStore2 = createUserGroupStore("test2", secMgr); addUsers(ugStore1, "user2", "abc"); addGroups(ugStore1, "group2"); GeoServerRoleStore roleStore = createRoleStore("test", secMgr, "role1"); expect(roleStore.getGroupNamesForRole(new GeoServerRole("role1"))) .andReturn(new TreeSet<String>(Arrays.asList("group1", "group2"))) .anyTimes(); replay(ugStore1, ugStore2, roleStore, secMgr); return secMgr; } });