Search in sources :

Example 1 with RandomAuthorizableNodeName

use of org.apache.jackrabbit.oak.security.user.RandomAuthorizableNodeName in project jackrabbit-oak by apache.

the class L14_AuthorizableNodeNameTest method testRandomAuthorizableNodeName.

@Test
public void testRandomAuthorizableNodeName() throws RepositoryException {
    // EXERCISE: uncomment the setup in 'getSecurityConfigParameters' before running this test.
    // verify that the configuration is correct:
    AuthorizableNodeName configured = getUserConfiguration().getParameters().getConfigValue(UserConstants.PARAM_AUTHORIZABLE_NODE_NAME, AuthorizableNodeName.DEFAULT);
    assertNotSame(AuthorizableNodeName.DEFAULT, configured);
    assertTrue(configured instanceof RandomAuthorizableNodeName);
    testUser = userManager.createUser("test/:User", null);
    String nodeName = Text.getName(testUser.getPath());
// EXERCISE: write the correct assertion wrt the generated node name.
}
Also used : RandomAuthorizableNodeName(org.apache.jackrabbit.oak.security.user.RandomAuthorizableNodeName) AuthorizableNodeName(org.apache.jackrabbit.oak.spi.security.user.AuthorizableNodeName) RandomAuthorizableNodeName(org.apache.jackrabbit.oak.security.user.RandomAuthorizableNodeName) AbstractSecurityTest(org.apache.jackrabbit.oak.AbstractSecurityTest) Test(org.junit.Test)

Aggregations

AbstractSecurityTest (org.apache.jackrabbit.oak.AbstractSecurityTest)1 RandomAuthorizableNodeName (org.apache.jackrabbit.oak.security.user.RandomAuthorizableNodeName)1 AuthorizableNodeName (org.apache.jackrabbit.oak.spi.security.user.AuthorizableNodeName)1 Test (org.junit.Test)1