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 group() {
  
          assertNull(Helper.getGroup(identityManager, "bottle washer"));
  
          Group admin = new Group("admin");
          Group manager = new Group("manager");
          Group user = new Group("user", manager);
  
          identityManager.add(admin);
          identityManager.add(manager);
          identityManager.add(user);
  
          // getGroup(IdentityManager identityManager, String groupPath)
          assertEquals("admin", admin, Helper.getGroup(identityManager, "admin"));
          assertEquals("/admin", admin, Helper.getGroup(identityManager, "/admin"));
          assertNull("/manager/", Helper.getGroup(identityManager, "/manager/"));
          assertEquals("/manager", manager, Helper.getGroup(identityManager, "/manager"));
          assertEquals("manager", manager, Helper.getGroup(identityManager, "manager"));
          assertNull("user", Helper.getGroup(identityManager, "user"));
          assertNull("/user", Helper.getGroup(identityManager, "/user"));
          assertEquals("/manager/user", user, Helper.getGroup(identityManager, "/manager/user"));
  
          // getGroup(IdentityManager identityManager, String groupName, Group parent)
          assertEquals("admin, null", admin, Helper.getGroup(identityManager, "admin", null));
          assertNull("/admin, null", Helper.getGroup(identityManager, "/admin", null));
          assertEquals("manager, null", manager, Helper.getGroup(identityManager, "manager", null));
          assertEquals("user, manager", user, Helper.getGroup(identityManager, "user", manager));
          assertNull("manager, user", Helper.getGroup(identityManager, "manager", user));
      }
test_case.class_method_signature: HelperTest.group()
test_case.full_signature: @Test public void group()
test_case.identifier: group
test_case.invocations: assertNull getGroup add add add assertEquals getGroup assertEquals getGroup assertNull getGroup assertEquals getGroup assertEquals getGroup assertNull getGroup assertNull getGroup assertEquals getGroup assertEquals getGroup assertNull getGroup assertEquals getGroup assertEquals getGroup assertNull getGroup
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void group()
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 Group getGroup(IdentityManager identityManager, String groupPath) throws IdentityManagementException {
          if (identityManager == null) {
              throw MESSAGES.nullArgument("IdentityManager");
          }
  
          if (isNullOrEmpty(groupPath)) {
              return null;
          }
  
          if (!groupPath.startsWith("/")) {
              groupPath = "/" + groupPath;
          }
  
          String[] paths = groupPath.split("/");
  
          if (paths.length > 0) {
              String name = paths[paths.length - 1];
              IdentityQueryBuilder queryBuilder = identityManager.getQueryBuilder();
              IdentityQuery<Group> query = queryBuilder.createIdentityQuery(Group.class)
                      .where(queryBuilder.equal(Group.NAME, name));
  
              List<Group> result = query.getResultList();
  
              for (Group storedGroup : result) {
                  if (storedGroup.getPath().equals(groupPath)) {
                      return storedGroup;
                  }
              }
          }
  
          return null;
      }
focal_method.class_method_signature: Helper.getGroup(IdentityManager identityManager, String groupPath)
focal_method.full_signature: public static Group getGroup(IdentityManager identityManager, String groupPath)
focal_method.identifier: getGroup
focal_method.invocations: nullArgument isNullOrEmpty startsWith split getQueryBuilder where createIdentityQuery equal getResultList equals getPath
focal_method.modifiers: public static
focal_method.parameters: (IdentityManager identityManager, String groupPath)
focal_method.return: Group
focal_method.signature: Group getGroup(IdentityManager identityManager, String groupPath)