use of org.apache.jackrabbit.oak.security.authorization.accesscontrol.InvalidTestPrincipal in project jackrabbit-oak by apache.
the class L5_AccessControlListImplTest method testAddEntryWithInvalidPrincipals.
public void testAddEntryWithInvalidPrincipals() throws Exception {
// EXERCISE: explain for each principal in the list why using it for an ACE fails
List<Principal> invalidPrincipals = ImmutableList.of(new InvalidTestPrincipal("unknown"), null, new PrincipalImpl(""), new Principal() {
@Override
public String getName() {
return "unknown";
}
});
for (Principal principal : invalidPrincipals) {
try {
acl.addAccessControlEntry(principal, testPrivileges);
fail("Adding an ACE with an invalid principal should fail");
} catch (AccessControlException e) {
// success
}
}
}
Aggregations