PrivilegeManagerFacade implements PrivilegeManager { @Override public Privilege registerPrivilege(final String privilegeName, final boolean isAbstract, final String[] declaredAggregateNames) throws RepositoryException { throw new ListenerReadOnlyException(); } PrivilegeManagerFacade(final @NotNull PrivilegeManager delegate); @Override Privilege[] getRegisteredPrivileges(); @Override Privilege getPrivilege(final String privilegeName); @Override Privilege registerPrivilege(final String privilegeName,
                                       final boolean isAbstract,
                                       final String[] declaredAggregateNames);  }
@Test(expected = ListenerReadOnlyException.class) public void testRORegisterPrivilege() throws Exception { PrivilegeManager delegate = mock(PrivilegeManager.class); PrivilegeManagerFacade facade = getFacade(delegate); facade.registerPrivilege("", true, new String[0]); }