JackrabbitAccessControlManagerFacade extends AccessControlManagerFacade<JackrabbitAccessControlManager> implements JackrabbitAccessControlManager { @Override public Privilege[] getPrivileges(String absPath, Set<Principal> principals) throws RepositoryException { return delegate.getPrivileges(absPath, principals); } @SuppressWarnings("WeakerAccess")  JackrabbitAccessControlManagerFacade(final @NotNull JackrabbitAccessControlManager delegate); @Override JackrabbitAccessControlPolicy[] getApplicablePolicies(Principal principal); @Override JackrabbitAccessControlPolicy[] getPolicies(Principal principal); @Override AccessControlPolicy[] getEffectivePolicies(Set<Principal> principals); @Override boolean hasPrivileges(String absPath, Set<Principal> principals, Privilege[] privileges); @Override Privilege[] getPrivileges(String absPath, Set<Principal> principals);  }
@Test public void testGetPrivileges() throws Exception { JackrabbitAccessControlManager delegate = mock(JackrabbitAccessControlManager.class); JackrabbitAccessControlManagerFacade facade = getFacade(delegate); final Set<Principal> principals = Collections.singleton(EveryonePrincipal.getInstance()); final Privilege[] privileges = new Privilege[0]; when(delegate.getPrivileges("/foo", principals)).thenReturn(privileges); assertNull("should be null in wrong path", facade.getPrivileges("", principals)); assertSame("should hasPrivileges", privileges, facade.getPrivileges("/foo", principals)); }