test_class.declarator: TREE_PATH = "/parent/path"
test_class.modifier: private static final
test_class.original_string: private static final String TREE_PATH = "/parent/path";
test_class.type: String
test_class.var_name: TREE_PATH
test_class.declarator: PROP_PATH = "/parent/path/prop"
test_class.modifier: private static final
test_class.original_string: private static final String PROP_PATH = "/parent/path/prop";
test_class.type: String
test_class.var_name: PROP_PATH
test_class.declarator: PARENT_PATH = PathUtils.getParentPath(TREE_PATH)
test_class.modifier: private final
test_class.original_string: private final String PARENT_PATH = PathUtils.getParentPath(TREE_PATH);
test_class.type: String
test_class.var_name: PARENT_PATH
test_class.declarator: pe = mock(PermissionEntry.class)
test_class.modifier: private
test_class.original_string: private PermissionEntry pe = mock(PermissionEntry.class);
test_class.type: PermissionEntry
test_class.var_name: pe
test_class.declarator: tree
test_class.modifier: private
test_class.original_string: private Tree tree;
test_class.type: Tree
test_class.var_name: tree
test_class.declarator: propertyState = PropertyStates.createProperty("prop", "value")
test_class.modifier: private
test_class.original_string: private PropertyState propertyState = PropertyStates.createProperty("prop", "value");
test_class.type: PropertyState
test_class.var_name: propertyState
test_class.file: oak-authorization-principalbased/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/principalbased/impl/EntryPredicateTest.java
test_class.identifier: EntryPredicateTest
test_case.body: @Test
      public void testCreateParentTree() {
          when(pe.appliesTo(PARENT_PATH)).thenReturn(true);
  
          Tree parentTree = mockTree(PARENT_PATH, true);
  
          when(tree.exists()).thenReturn(true);
          when(tree.getParent()).thenReturn(parentTree);
  
          Predicate<PermissionEntry> predicate = EntryPredicate.createParent(tree, Permissions.REMOVE_NODE|Permissions.READ_PROPERTY|Permissions.LOCK_MANAGEMENT);
          predicate.apply(pe);
  
          verify(pe, never()).matches();
          verify(pe, never()).matches(TREE_PATH);
          verify(pe, never()).matches(PARENT_PATH);
          verify(pe, times(1)).appliesTo(PARENT_PATH);
          verify(pe, times(1)).matches(parentTree, null);
          verify(pe, never()).matches(tree, null);
          verify(pe, never()).getPrivilegeBits();
      }
test_case.class_method_signature: EntryPredicateTest.testCreateParentTree()
test_case.full_signature: @Test public void testCreateParentTree()
test_case.identifier: testCreateParentTree
test_case.invocations: thenReturn when appliesTo mockTree thenReturn when exists thenReturn when getParent createParent apply matches verify never matches verify never matches verify never appliesTo verify times matches verify times matches verify never getPrivilegeBits verify never
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateParentTree()
focal_class.file: oak-authorization-principalbased/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/principalbased/impl/EntryPredicate.java
focal_class.identifier: EntryPredicate
focal_class.class_method_signature: EntryPredicate.EntryPredicate()
focal_class.full_signature: private  EntryPredicate()
focal_class.identifier: EntryPredicate
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  EntryPredicate()
focal_class.class_method_signature: EntryPredicate.create(@Nullable String oakPath)
focal_class.full_signature: @NotNull static Predicate<PermissionEntry> create(@Nullable String oakPath)
focal_class.identifier: create
focal_class.modifiers: @NotNull static
focal_class.parameters: (@Nullable String oakPath)
focal_class.return: Predicate<PermissionEntry>
focal_class.signature: Predicate<PermissionEntry> create(@Nullable String oakPath)
focal_class.class_method_signature: EntryPredicate.create(@NotNull Tree tree, @Nullable PropertyState property)
focal_class.full_signature: @NotNull static Predicate<PermissionEntry> create(@NotNull Tree tree, @Nullable PropertyState property)
focal_class.identifier: create
focal_class.modifiers: @NotNull static
focal_class.parameters: (@NotNull Tree tree, @Nullable PropertyState property)
focal_class.return: Predicate<PermissionEntry>
focal_class.signature: Predicate<PermissionEntry> create(@NotNull Tree tree, @Nullable PropertyState property)
focal_class.class_method_signature: EntryPredicate.createParent(@NotNull String treePath, @Nullable Tree parentTree, long permissions)
focal_class.full_signature: @NotNull static Predicate<PermissionEntry> createParent(@NotNull String treePath, @Nullable Tree parentTree, long permissions)
focal_class.identifier: createParent
focal_class.modifiers: @NotNull static
focal_class.parameters: (@NotNull String treePath, @Nullable Tree parentTree, long permissions)
focal_class.return: Predicate<PermissionEntry>
focal_class.signature: Predicate<PermissionEntry> createParent(@NotNull String treePath, @Nullable Tree parentTree, long permissions)
focal_class.class_method_signature: EntryPredicate.createParent(@NotNull Tree tree, long permissions)
focal_class.full_signature: @NotNull static Predicate<PermissionEntry> createParent(@NotNull Tree tree, long permissions)
focal_class.identifier: createParent
focal_class.modifiers: @NotNull static
focal_class.parameters: (@NotNull Tree tree, long permissions)
focal_class.return: Predicate<PermissionEntry>
focal_class.signature: Predicate<PermissionEntry> createParent(@NotNull Tree tree, long permissions)
focal_method.body: @NotNull
      static Predicate<PermissionEntry> createParent(@NotNull String treePath, @Nullable Tree parentTree, long permissions) {
          if (!Permissions.respectParentPermissions(permissions)) {
              return Predicates.alwaysFalse();
          }
          if (treePath.isEmpty() || PathUtils.denotesRoot(treePath)) {
              return Predicates.alwaysFalse();
          } else if (parentTree != null && parentTree.exists()) {
              return permissionEntry -> permissionEntry.appliesTo(parentTree.getPath()) && permissionEntry.matches(parentTree, null);
          } else {
              String parentPath = PathUtils.getParentPath(treePath);
              return permissionEntry -> permissionEntry.appliesTo(parentPath) && permissionEntry.matches(parentPath);
          }
      }
focal_method.class_method_signature: EntryPredicate.createParent(@NotNull String treePath, @Nullable Tree parentTree, long permissions)
focal_method.full_signature: @NotNull static Predicate<PermissionEntry> createParent(@NotNull String treePath, @Nullable Tree parentTree, long permissions)
focal_method.identifier: createParent
focal_method.invocations: respectParentPermissions alwaysFalse isEmpty denotesRoot alwaysFalse exists appliesTo getPath matches getParentPath appliesTo matches
focal_method.modifiers: @NotNull static
focal_method.parameters: (@NotNull String treePath, @Nullable Tree parentTree, long permissions)
focal_method.return: Predicate<PermissionEntry>
focal_method.signature: Predicate<PermissionEntry> createParent(@NotNull String treePath, @Nullable Tree parentTree, long permissions)