ImpersonationFacade implements Impersonation { @Override public boolean revokeImpersonation(final Principal principal) throws RepositoryException { throw new ListenerReadOnlyException(); } @SuppressWarnings("WeakerAccess")  ImpersonationFacade(final @NotNull Impersonation delegate); @Override PrincipalIterator getImpersonators(); @Override boolean allows(final Subject subject); @Override boolean grantImpersonation(final Principal principal); @Override boolean revokeImpersonation(final Principal principal);  }
@Test(expected = ListenerReadOnlyException.class) public void testRORevokeImpersonation() throws Exception { Impersonation delegate = mock(Impersonation.class); ImpersonationFacade facade = getFacade(delegate); facade.revokeImpersonation(null); }