Esempio n. 1
0
 @Test
 public void testCreateUser() throws Exception {
   boolean found = false;
   user1UserManagementClient.addUser(
       NEW_USER,
       NEW_USER_PW,
       new String[] {PermissionTestConstants.EVERYONE_ROLE},
       "testUserAProfile");
   FlaggedName[] flaggedNames = adminUserManagementClient.getRolesOfUser(NEW_USER, "*", 100);
   for (FlaggedName name : flaggedNames) {
     if (PermissionTestConstants.EVERYONE_ROLE.equalsIgnoreCase(name.getItemName())) {
       found = true;
     }
   }
   Assert.assertTrue(found, NEW_USER + " is not in internal/everyone");
 }
Esempio n. 2
0
 @AfterClass(alwaysRun = true)
 public void cleanup() throws Exception {
   adminUserManagementClient.deleteRole(ROLE_NAME);
   adminUserManagementClient.updateUserListOfRole(EXISTING_ROLE, ROLE_USERS, new String[] {});
   if (adminUserManagementClient.roleNameExists(NEW_ROLE)) {
     adminUserManagementClient.deleteRole(NEW_ROLE);
   }
   FlaggedName[] flaggedNames = adminUserManagementClient.getRolesOfUser(NEW_USER, "*", 100);
   for (FlaggedName name : flaggedNames) {
     if (name.getItemName().equals(PermissionTestConstants.EVERYONE_ROLE)) {
       adminUserManagementClient.deleteUser(NEW_USER);
     }
   }
   adminUserManagementClient = null;
   user1UserManagementClient = null;
 }