use of org.apache.jackrabbit.oak.spi.commit.Validator in project jackrabbit-oak by apache.
the class AccessControlValidatorTest method hiddenNodeDeleted.
@Test
public void hiddenNodeDeleted() throws CommitFailedException {
AccessControlValidatorProvider provider = new AccessControlValidatorProvider(getSecurityProvider());
MemoryNodeStore store = new MemoryNodeStore();
NodeBuilder builder = store.getRoot().builder();
builder.child("test").child(":hidden");
NodeState root = builder.getNodeState();
builder = root.builder();
NodeBuilder test = builder.child("test");
test.child(":hidden").remove();
Validator validator = provider.getRootValidator(root, builder.getNodeState(), CommitInfo.EMPTY);
Validator childValidator = validator.childNodeChanged("test", root.getChildNode("test"), test.getNodeState());
assertNotNull(childValidator);
Validator hiddenValidator = childValidator.childNodeDeleted(":hidden", root.getChildNode("test").getChildNode(":hidden"));
assertNull(hiddenValidator);
}
use of org.apache.jackrabbit.oak.spi.commit.Validator in project jackrabbit-oak by apache.
the class UserValidatorTest method hiddenNodeDeleted.
@Test
public void hiddenNodeDeleted() throws CommitFailedException {
UserValidatorProvider provider = new UserValidatorProvider(getConfig());
MemoryNodeStore store = new MemoryNodeStore();
NodeBuilder builder = store.getRoot().builder();
builder.child("test").child(":hidden");
NodeState root = builder.getNodeState();
builder = root.builder();
NodeBuilder test = builder.child("test");
test.child(":hidden").remove();
Validator validator = provider.getRootValidator(root, builder.getNodeState(), CommitInfo.EMPTY);
Validator childValidator = validator.childNodeChanged("test", root.getChildNode("test"), test.getNodeState());
assertNotNull(childValidator);
Validator hiddenValidator = childValidator.childNodeDeleted(":hidden", root.getChildNode("test").getChildNode(":hidden"));
assertNull(hiddenValidator);
}
Aggregations