Search in sources :

Example 6 with AuthorizableNodeName

use of org.apache.jackrabbit.oak.spi.security.user.AuthorizableNodeName 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

AuthorizableNodeName (org.apache.jackrabbit.oak.spi.security.user.AuthorizableNodeName)6 Test (org.junit.Test)6 AbstractSecurityTest (org.apache.jackrabbit.oak.AbstractSecurityTest)4 Field (java.lang.reflect.Field)2 Nonnull (javax.annotation.Nonnull)2 Tree (org.apache.jackrabbit.oak.api.Tree)1 RandomAuthorizableNodeName (org.apache.jackrabbit.oak.security.user.RandomAuthorizableNodeName)1 ConfigurationParameters (org.apache.jackrabbit.oak.spi.security.ConfigurationParameters)1 SecurityProvider (org.apache.jackrabbit.oak.spi.security.SecurityProvider)1