protected Group createGroup(String name) { if (name != null) { final Group group = SecurityManagementUtils.createGroup(name); return group; } return null; }
protected Group createGroup(String name) { if (name != null) { final Group group = SecurityManagementUtils.createGroup(name); return group; } return null; }
@Override protected Group createEntity(String identifier) { return SecurityManagementUtils.createGroup(identifier); } }
protected Group createGroup(String name) { return SecurityManagementUtils.createGroup(name); }
protected Group createGroup( String name ) { return SecurityManagementUtils.createGroup( name ); }
protected Group createGroup(String name) { return SecurityManagementUtils.createGroup(name); }
protected Group createGroup(org.apache.catalina.Role group) { if (group == null) { return null; } return SecurityManagementUtils.createGroup(group.getRolename()); }
/** * Utility method that check if the given group or role name is in the list of registeredRoles, if it is, * it adds the Role for the given name in the given roles set argument, otherwise, into the list. * This method it's just a shortcut to avoid code duplipcation on several points. */ public static void populateGroupOrRoles(final String name, final Set<String> registeredRoles, final Set<Group> groups, final Set<Role> roles) { if (registeredRoles.contains(name)) { // Is a role. Role r = createRole(name); if (null != r) { roles.add(r); } } else { // Is a group. Group g = createGroup(name); if (null != g) { groups.add(g); } } }
private List<Group> createGroupList(String... names) { if (names != null) { List<Group> result = new ArrayList<Group>(names.length); for (int x = 0; x < names.length; x++) { String name = names[x]; Group g = SecurityManagementUtils.createGroup(name); result.add(g); } return result; } return null; }
private List<Group> createGroupList(String... names) { if (names != null) { List<Group> result = new ArrayList<Group>(names.length); for (int x = 0; x < names.length; x++) { String name = names[x]; Group g = SecurityManagementUtils.createGroup(name); result.add(g); } return result; } return null; }
private List<Group> createGroupList(String... names) { if (names != null) { List<Group> result = new ArrayList<Group>(names.length); for (int x = 0; x < names.length; x++) { String name = names[x]; Group g = SecurityManagementUtils.createGroup(name); result.add(g); } return result; } return null; }
private List<Group> createGroupList(String... names) { if (names != null) { List<Group> result = new ArrayList<Group>(names.length); for (int x = 0; x < names.length; x++) { String name = names[x]; Group g = SecurityManagementUtils.createGroup(name); result.add(g); } return result; } return null; }
private List<Group> createGroupList(String... names) { if (names != null) { List<Group> result = new ArrayList<Group>(names.length); for (int x = 0; x < names.length; x++) { String name = names[x]; Group g = SecurityManagementUtils.createGroup(name); result.add(g); } return result; } return null; }
@Test(expected = UnsupportedServiceCapabilityException.class) public void testUpdateGroup() { groupsManager.update(SecurityManagementUtils.createGroup("id1")); }
@Test(expected = UnsupportedServiceCapabilityException.class) public void testUpdateGroup() { groupsManager.update(SecurityManagementUtils.createGroup("id1")); }
@Test public void testCreateGroup() { final String testId = "id1"; final Group group = SecurityManagementUtils.createGroup(testId); assertNotNull(group); final String name = group.getName(); assertEquals(name, testId); }
@Test public void testCreateUserWithGroups() { final String testId = "id1"; final String group1Id = "g1"; final String group2Id = "g2"; final Group group1 = SecurityManagementUtils.createGroup(group1Id); final Group group2 = SecurityManagementUtils.createGroup(group2Id); final Set<Group> groups = new HashSet<Group>(2); groups.add(group1); groups.add(group2); final User user = SecurityManagementUtils.createUser(testId, groups); assertNotNull(user); final String id = user.getIdentifier(); assertEquals(id, testId); final Set<Group> resultGroups = user.getGroups(); assertNotNull(resultGroups); assertTrue(resultGroups.size() == 2); assertEquals(resultGroups, groups); }
@Test public void testCreateUserWithGroups() { final String testId = "id1"; final String group1Id = "g1"; final String group2Id = "g2"; final Group group1 = SecurityManagementUtils.createGroup(group1Id); final Group group2 = SecurityManagementUtils.createGroup(group2Id); final Set<Group> groups = new HashSet<Group>(2); groups.add(group1); groups.add(group2); final User user = SecurityManagementUtils.createUser(testId, groups); assertNotNull(user); final String id = user.getIdentifier(); assertEquals(id, testId); final Set<Group> resultGroups = user.getGroups(); assertNotNull(resultGroups); assertTrue(resultGroups.size() == 2); assertEquals(resultGroups, groups); }
@Test public void testCreateGroup() { final String testId = "id1"; final Group group = SecurityManagementUtils.createGroup(testId); assertNotNull(group); final String name = group.getName(); assertEquals(name, testId); }
final String role1Id = "r1"; final String role2Id = "r2"; final Group group1 = SecurityManagementUtils.createGroup(group1Id); final Group group2 = SecurityManagementUtils.createGroup(group2Id); final Set<Group> groups = new HashSet<Group>(2); groups.add(group1);