GeoServerRoleService activeRoleService = createNiceMock(GeoServerRoleService.class);
expect(activeRoleService.getName()).andReturn("foo").anyTimes();
expect(secMgr.getActiveRoleService()).andReturn(activeRoleService).anyTimes();
expect(secMgr.listRoleServices()).andReturn(new TreeSet<String>(
Arrays.asList("test1", "test2", "test3", "test4"))).anyTimes();
replay(roleService1, roleService2, roleService3, roleService4, activeRoleService, secMgr);
validator = new XMLSecurityConfigValidator(secMgr);