PrivilegeValidator extends DefaultValidator implements PrivilegeConstants { @Override public void propertyDeleted(PropertyState before) throws CommitFailedException { throw new CommitFailedException(CONSTRAINT, 46, "Attempt to modify existing privilege definition."); } PrivilegeValidator(@NotNull Root before, @NotNull Root after, @NotNull TreeProvider treeProvider); @Override void propertyAdded(PropertyState after); @Override void propertyChanged(PropertyState before, PropertyState after); @Override void propertyDeleted(PropertyState before); @Override Validator childNodeAdded(String name, NodeState after); @Override Validator childNodeChanged(String name, NodeState before, NodeState after); @Override Validator childNodeDeleted(String name, NodeState before);  }
@Test(expected = CommitFailedException.class) public void testPropertyDeleted() throws Exception { try { PropertyState before = PropertyStates.createProperty(REP_AGGREGATES, ImmutableList.of(REP_READ_NODES, REP_READ_PROPERTIES), Type.NAMES); PrivilegeValidator validator = new PrivilegeValidator(root, root, getTreeProvider()); validator.propertyDeleted(before); } catch (CommitFailedException e) { throw assertCommitFailed(e, 46); } }