public void testNodeIsModifiedAfterSecondSetPolicy() throws RepositoryException, AccessDeniedException, NotExecutableException {
checkCanModifyAc(path);
// make sure a policy has been explicitely set.
AccessControlPolicyIterator it = acMgr.getApplicablePolicies(path);
if (it.hasNext()) {
AccessControlPolicy policy = it.nextAccessControlPolicy();
acMgr.setPolicy(path, policy);
superuser.save();
// remember for tearDown
addedPolicies.put(path, policy);
} else {
throw new NotExecutableException();
}
// call 'setPolicy' a second time -> Node must be modified.
it = acMgr.getApplicablePolicies(path);
try {
if (it.hasNext()) {
Item item = superuser.getItem(path);
AccessControlPolicy policy = it.nextAccessControlPolicy();
acMgr.setPolicy(path, policy);
assertTrue("After setting a policy the node must be marked modified.", item.isModified());
} else {
throw new NotExecutableException();