AbstractAccessControlList implements JackrabbitAccessControlList { @Override public boolean addEntry(@NotNull Principal principal, @NotNull Privilege[] privileges, boolean isAllow) throws RepositoryException { return addEntry(principal, privileges, isAllow, Collections.<String, Value>emptyMap()); } AbstractAccessControlList(@Nullable String oakPath,
                                     @NotNull NamePathMapper namePathMapper); @Nullable String getOakPath(); @NotNull NamePathMapper getNamePathMapper(); @NotNull abstract List<? extends JackrabbitAccessControlEntry> getEntries(); @NotNull abstract RestrictionProvider getRestrictionProvider(); @Nullable @Override String getPath(); @Override AccessControlEntry[] getAccessControlEntries(); @Override boolean addAccessControlEntry(Principal principal, Privilege[] privileges); @Override boolean isEmpty(); @Override int size(); @NotNull @Override String[] getRestrictionNames(); @Override int getRestrictionType(@NotNull String restrictionName); @Override boolean isMultiValueRestriction(@NotNull String restrictionName); @Override boolean addEntry(@NotNull Principal principal, @NotNull Privilege[] privileges, boolean isAllow); @Override boolean addEntry(@NotNull Principal principal, @NotNull Privilege[] privileges, boolean isAllow, @Nullable Map<String, Value> restrictions);  }
@Test public void testAddEntry() throws Exception { AbstractAccessControlList acl = spy(createEmptyACL()); Privilege[] privs = new Privilege[0]; acl.addEntry(testPrincipal, privs, false); verify(acl, times(1)).addEntry(testPrincipal, privs, false, Collections.emptyMap()); }
@Test public void testAddEntryWithRestrictions() throws Exception { AbstractAccessControlList acl = spy(createEmptyACL()); Privilege[] privs = new Privilege[0]; Map<String, Value> restrictions = Collections.singletonMap("name", mock(Value.class)); acl.addEntry(testPrincipal, privs, false, restrictions); verify(acl, times(1)).addEntry(testPrincipal, privs, false, restrictions, null); }