PrivilegeManagerImpl implements PrivilegeManager { @NotNull @Override public Privilege[] getRegisteredPrivileges() { Set<Privilege> privileges = new HashSet<>(); for (PrivilegeDefinition def : getPrivilegeDefinitions()) { privileges.add(getPrivilege(def)); } return privileges.toArray(new Privilege[0]); } PrivilegeManagerImpl(Root root, NamePathMapper namePathMapper); @NotNull @Override Privilege[] getRegisteredPrivileges(); @NotNull @Override Privilege getPrivilege(@NotNull String privilegeName); @NotNull @Override Privilege registerPrivilege(@NotNull String privilegeName, boolean isAbstract,
                                       @Nullable String[] declaredAggregateNames);  }
@Test public void testGetRegisteredPrivileges() throws RepositoryException { Privilege[] registered = privilegeManager.getRegisteredPrivileges(); assertNotNull(registered); assertNotEquals(1, registered.length); }
@Test public void testGetRegisteredPrivilegesFromEmptyRoot() throws RepositoryException { Privilege[] registered = create(getRootProvider().createReadOnlyRoot(EmptyNodeState.EMPTY_NODE)).getRegisteredPrivileges(); assertNotNull(registered); assertEquals(0, registered.length); }