test_class.declarator: WORKING_DIRECTORY = "./target/picketlink"
test_class.modifier: private static final
test_class.original_string: private static final String WORKING_DIRECTORY = "./target/picketlink";
test_class.type: String
test_class.var_name: WORKING_DIRECTORY
test_class.declarator: REALM_NAME = "myRealm"
test_class.modifier: private static final
test_class.original_string: private static final String REALM_NAME = "myRealm";
test_class.type: String
test_class.var_name: REALM_NAME
test_class.declarator: identityManager
test_class.modifier: private final
test_class.original_string: private final IdentityManager identityManager;
test_class.type: IdentityManager
test_class.var_name: identityManager
test_class.declarator: relationshipManager
test_class.modifier: private final
test_class.original_string: private final RelationshipManager relationshipManager;
test_class.type: RelationshipManager
test_class.var_name: relationshipManager
test_class.file: authentication/identity-store/identity-store-mutable/src/test/java/javax/security/idm/model/HelperTest.java
test_class.identifier: HelperTest
test_case.body: @Test
      public void role() {
  
          assertNull(Helper.getRole(identityManager, "bottle washer"));
  
          Role admin = new Role("admin");
          Role manager = new Role("manager");
          Role user = new Role("user");
  
          identityManager.add(admin);
          identityManager.add(manager);
          identityManager.add(user);
  
          assertEquals("admin", admin, Helper.getRole(identityManager, "admin"));
          assertEquals("manager", manager, Helper.getRole(identityManager, "manager"));
          assertEquals("user", user, Helper.getRole(identityManager, "user"));
      }
test_case.class_method_signature: HelperTest.role()
test_case.full_signature: @Test public void role()
test_case.identifier: role
test_case.invocations: assertNull getRole add add add assertEquals getRole assertEquals getRole assertEquals getRole
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void role()
focal_class.file: authentication/identity-store/identity-store-mutable/src/main/java/javax/security/idm/model/Helper.java
focal_class.identifier: Helper
focal_class.class_method_signature: Helper.getCaller(IdentityManager identityManager, String loginName)
focal_class.full_signature: public static Caller getCaller(IdentityManager identityManager, String loginName)
focal_class.identifier: getCaller
focal_class.modifiers: public static
focal_class.parameters: (IdentityManager identityManager, String loginName)
focal_class.return: Caller
focal_class.signature: Caller getCaller(IdentityManager identityManager, String loginName)
focal_class.class_method_signature: Helper.getRole(IdentityManager identityManager, String name)
focal_class.full_signature: public static Role getRole(IdentityManager identityManager, String name)
focal_class.identifier: getRole
focal_class.modifiers: public static
focal_class.parameters: (IdentityManager identityManager, String name)
focal_class.return: Role
focal_class.signature: Role getRole(IdentityManager identityManager, String name)
focal_class.class_method_signature: Helper.getGroup(IdentityManager identityManager, String groupPath)
focal_class.full_signature: public static Group getGroup(IdentityManager identityManager, String groupPath)
focal_class.identifier: getGroup
focal_class.modifiers: public static
focal_class.parameters: (IdentityManager identityManager, String groupPath)
focal_class.return: Group
focal_class.signature: Group getGroup(IdentityManager identityManager, String groupPath)
focal_class.class_method_signature: Helper.getGroup(IdentityManager identityManager, String groupName, Group parent)
focal_class.full_signature: public static Group getGroup(IdentityManager identityManager, String groupName, Group parent)
focal_class.identifier: getGroup
focal_class.modifiers: public static
focal_class.parameters: (IdentityManager identityManager, String groupName, Group parent)
focal_class.return: Group
focal_class.signature: Group getGroup(IdentityManager identityManager, String groupName, Group parent)
focal_class.class_method_signature: Helper.isMember(RelationshipManager relationshipManager, Account member, Group group)
focal_class.full_signature: public static boolean isMember(RelationshipManager relationshipManager, Account member, Group group)
focal_class.identifier: isMember
focal_class.modifiers: public static
focal_class.parameters: (RelationshipManager relationshipManager, Account member, Group group)
focal_class.return: boolean
focal_class.signature: boolean isMember(RelationshipManager relationshipManager, Account member, Group group)
focal_class.class_method_signature: Helper.addToGroup(RelationshipManager relationshipManager, Account member, Group group)
focal_class.full_signature: public static void addToGroup(RelationshipManager relationshipManager, Account member, Group group)
focal_class.identifier: addToGroup
focal_class.modifiers: public static
focal_class.parameters: (RelationshipManager relationshipManager, Account member, Group group)
focal_class.return: void
focal_class.signature: void addToGroup(RelationshipManager relationshipManager, Account member, Group group)
focal_class.class_method_signature: Helper.removeFromGroup(RelationshipManager relationshipManager, Account member, Group group)
focal_class.full_signature: public static void removeFromGroup(RelationshipManager relationshipManager, Account member, Group group)
focal_class.identifier: removeFromGroup
focal_class.modifiers: public static
focal_class.parameters: (RelationshipManager relationshipManager, Account member, Group group)
focal_class.return: void
focal_class.signature: void removeFromGroup(RelationshipManager relationshipManager, Account member, Group group)
focal_class.class_method_signature: Helper.hasRole(RelationshipManager relationshipManager, RoleAssignable assignee, Role role)
focal_class.full_signature: public static boolean hasRole(RelationshipManager relationshipManager, RoleAssignable assignee, Role role)
focal_class.identifier: hasRole
focal_class.modifiers: public static
focal_class.parameters: (RelationshipManager relationshipManager, RoleAssignable assignee, Role role)
focal_class.return: boolean
focal_class.signature: boolean hasRole(RelationshipManager relationshipManager, RoleAssignable assignee, Role role)
focal_class.class_method_signature: Helper.grantRole(RelationshipManager relationshipManager, RoleAssignable assignee, Role role)
focal_class.full_signature: public static void grantRole(RelationshipManager relationshipManager, RoleAssignable assignee, Role role)
focal_class.identifier: grantRole
focal_class.modifiers: public static
focal_class.parameters: (RelationshipManager relationshipManager, RoleAssignable assignee, Role role)
focal_class.return: void
focal_class.signature: void grantRole(RelationshipManager relationshipManager, RoleAssignable assignee, Role role)
focal_class.class_method_signature: Helper.revokeRole(RelationshipManager relationshipManager, RoleAssignable assignee, Role role)
focal_class.full_signature: public static void revokeRole(RelationshipManager relationshipManager, RoleAssignable assignee, Role role)
focal_class.identifier: revokeRole
focal_class.modifiers: public static
focal_class.parameters: (RelationshipManager relationshipManager, RoleAssignable assignee, Role role)
focal_class.return: void
focal_class.signature: void revokeRole(RelationshipManager relationshipManager, RoleAssignable assignee, Role role)
focal_method.body: public static Role getRole(IdentityManager identityManager, String name) throws IdentityManagementException {
          if (identityManager == null) {
              throw MESSAGES.nullArgument("IdentityManager");
          }
  
          if (isNullOrEmpty(name)) {
              return null;
          }
  
          IdentityQueryBuilder queryBuilder = identityManager.getQueryBuilder();
          List<Role> roles = queryBuilder.createIdentityQuery(Role.class)
                  .where(queryBuilder.equal(Role.NAME, name)).getResultList();
  
          if (roles.isEmpty()) {
              return null;
          } else if (roles.size() == 1) {
              return roles.get(0);
          } else {
              throw new IdentityManagementException("Error - multiple Role objects found with same name");
          }
      }
focal_method.class_method_signature: Helper.getRole(IdentityManager identityManager, String name)
focal_method.full_signature: public static Role getRole(IdentityManager identityManager, String name)
focal_method.identifier: getRole
focal_method.invocations: nullArgument isNullOrEmpty getQueryBuilder getResultList where createIdentityQuery equal isEmpty size get
focal_method.modifiers: public static
focal_method.parameters: (IdentityManager identityManager, String name)
focal_method.return: Role
focal_method.signature: Role getRole(IdentityManager identityManager, String name)