AbstractAccessControlManager implements JackrabbitAccessControlManager, AccessControlConstants { @NotNull protected Tree getTree(@Nullable String oakPath, long permissions, boolean checkAcContent) throws RepositoryException { Tree tree = (oakPath == null) ? root.getTree("/") : root.getTree(oakPath); if (!tree.exists()) { throw new PathNotFoundException("No tree at " + oakPath); } if (permissions != Permissions.NO_PERMISSION) { checkPermissions((oakPath == null) ? null : tree, permissions); } if (checkAcContent && config.getContext().definesTree(tree)) { throw new AccessControlException("Tree " + tree.getPath() + " defines access control content."); } return tree; } protected  AbstractAccessControlManager(@NotNull Root root,
                                           @NotNull NamePathMapper namePathMapper,
                                           @NotNull SecurityProvider securityProvider); @NotNull @Override Privilege[] getSupportedPrivileges(@Nullable String absPath); @NotNull @Override Privilege privilegeFromName(@NotNull String privilegeName); @Override boolean hasPrivileges(@Nullable String absPath, @Nullable Privilege[] privileges); @NotNull @Override Privilege[] getPrivileges(@Nullable String absPath); @Override boolean hasPrivileges(@Nullable String absPath, @NotNull Set<Principal> principals, @Nullable Privilege[] privileges); @NotNull @Override Privilege[] getPrivileges(@Nullable String absPath, @NotNull Set<Principal> principals);  }
@Test public void testGetTreeTestPath() throws Exception { assertNotNull(acMgr.getTree(testPath, Permissions.NO_PERMISSION, false)); assertNotNull(acMgr.getTree(testPath, Permissions.NO_PERMISSION, true)); }
@Test(expected = PathNotFoundException.class) public void testGetTreeNonExstingPath() throws Exception { acMgr.getTree(nonExistingPath, Permissions.NO_PERMISSION, false); }
@Test public void testGetTreeNullPath() throws Exception { assertNotNull(acMgr.getTree(null, Permissions.NO_PERMISSION, false)); }
@Test public void testGetTreeNullPathCheckPermission() throws Exception { assertNotNull(acMgr.getTree(null, Permissions.ALL, false)); }
@Test(expected = AccessControlException.class) public void testGetTreeDefinesAcContent() throws Exception { Context ctx = new Context.Default() { @Override public boolean definesTree(@NotNull Tree tree) { return true; } }; when(authorizationConfiguration.getContext()).thenReturn(ctx); acMgr.getTree(testPath, Permissions.NO_PERMISSION, true); }