GeoServerSecurityManager secMgr = getSecurityManager();
GeoServerUserGroupStore ugStore1 = (GeoServerUserGroupStore) secMgr.loadUserGroupService("test1");
GeoServerUserGroupStore ugStore2 = (GeoServerUserGroupStore) secMgr.loadUserGroupService("test2");
RoleStoreValidationWrapper store = new RoleStoreValidationWrapper(
(GeoServerRoleStore)secMgr.loadRoleService("test"), ugStore1, ugStore2);
GeoServerRole role1 = store.getRoleByName("role1");
try {
store.associateRoleToGroup(role1, "group3");
fail("unkown group should throw exception");