@Test public void testRequireRootAclUpdate() throws Exception { // everyone principle does not exist, update should be required assertTrue( provider.requireRootAclUpdate( editor ) ); // add everyone principle when( aclEntry.getPrincipal() ).thenReturn( everyone ); // everyone principle exists, but the JCR_READ_ACCESS_CONTROL privilege is not yet added, update should be required assertTrue( provider.requireRootAclUpdate( editor ) ); // add the JCR_READ_ACCESS_CONTROL privilege Privilege[] privs = new Privilege[] { jcrReadAccessControlPriv }; when( aclEntry.getPrivileges() ).thenReturn( privs ); // everyone principle exists and it had the the JCR_READ_ACCESS_CONTROL privilege, update should not be required assertFalse( provider.requireRootAclUpdate( editor ) ); } }