Util implements AccessControlConstants { static boolean isACE(@NotNull Tree tree, @NotNull ReadOnlyNodeTypeManager ntMgr) { return tree.exists() && ntMgr.isNodeType(tree, NT_REP_ACE); } private  Util();   }
@Test public void testIsAceNonExistingTree() { Tree t = when(mock(Tree.class).exists()).thenReturn(false).getMock(); assertFalse(Util.isACE(t, ReadOnlyNodeTypeManager.getInstance(root, getNamePathMapper()))); }
@Test public void testIsAceOtherTree() { assertFalse(Util.isACE(root.getTree(PathUtils.ROOT_PATH), ReadOnlyNodeTypeManager.getInstance(root, getNamePathMapper()))); }
@Test public void testIsAce() { Tree t = when(mock(Tree.class).exists()).thenReturn(true).getMock(); when(t.getProperty(JCR_PRIMARYTYPE)).thenReturn(PropertyStates.createProperty(JCR_PRIMARYTYPE, AccessControlConstants.NT_REP_DENY_ACE, Type.NAME)); assertTrue(Util.isACE(t, ReadOnlyNodeTypeManager.getInstance(root, getNamePathMapper()))); }