assertEquals(FILE_CREATE_FAILED_$1, ex.getId());
assertEquals(invalidPath, ex.getArgs()[0]);
}
}
GeoServerSecurityManager secMgr = createNiceMock(GeoServerSecurityManager.class);
GeoServerRoleService roleService1 = createNiceMock(GeoServerRoleService.class);
expect(roleService1.getRoleCount()).andReturn(0).anyTimes();
expect(secMgr.loadRoleService("test1")).andReturn(roleService1).anyTimes();
GeoServerRoleService roleService2 = createNiceMock(GeoServerRoleService.class);
expect(roleService2.getRoleCount()).andReturn(1).anyTimes();
expect(secMgr.loadRoleService("test2")).andReturn(roleService2).anyTimes();
GeoServerRoleService roleService3 = createNiceMock(GeoServerRoleService.class);
expect(roleService3.getRoleCount()).andReturn(1).anyTimes();
expect(secMgr.loadRoleService("test3")).andReturn(roleService3).anyTimes();
GeoServerRoleService roleService4 = createNiceMock(GeoServerRoleService.class);
expect(roleService4.getRoleCount()).andReturn(1).anyTimes();
expect(secMgr.loadRoleService("test4")).andReturn(roleService4).anyTimes();
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);