Search in sources :

Example 6 with MoveTracker

use of org.apache.jackrabbit.oak.spi.commit.MoveTracker in project jackrabbit-oak by apache.

the class ExternalPrincipalConfigurationTest method testGetValidators.

@Test
public void testGetValidators() {
    ContentSession cs = root.getContentSession();
    List<? extends ValidatorProvider> validatorProviders = principalConfiguration.getValidators(cs.getWorkspaceName(), cs.getAuthInfo().getPrincipals(), new MoveTracker());
    assertFalse(validatorProviders.isEmpty());
    assertEquals(1, validatorProviders.size());
    assertTrue(validatorProviders.get(0) instanceof ExternalIdentityValidatorProvider);
    validatorProviders = principalConfiguration.getValidators(cs.getWorkspaceName(), cs.getAuthInfo().getPrincipals(), new MoveTracker());
    assertFalse(validatorProviders.isEmpty());
    assertEquals(1, validatorProviders.size());
    assertTrue(validatorProviders.get(0) instanceof ExternalIdentityValidatorProvider);
    enable();
    validatorProviders = principalConfiguration.getValidators(cs.getWorkspaceName(), cs.getAuthInfo().getPrincipals(), new MoveTracker());
    assertFalse(validatorProviders.isEmpty());
    assertEquals(1, validatorProviders.size());
    assertTrue(validatorProviders.get(0) instanceof ExternalIdentityValidatorProvider);
}
Also used : ContentSession(org.apache.jackrabbit.oak.api.ContentSession) MoveTracker(org.apache.jackrabbit.oak.spi.commit.MoveTracker) AbstractExternalAuthTest(org.apache.jackrabbit.oak.spi.security.authentication.external.AbstractExternalAuthTest) Test(org.junit.Test)

Aggregations

MoveTracker (org.apache.jackrabbit.oak.spi.commit.MoveTracker)6 Test (org.junit.Test)6 AbstractSecurityTest (org.apache.jackrabbit.oak.AbstractSecurityTest)3 ContentSession (org.apache.jackrabbit.oak.api.ContentSession)2 AbstractExternalAuthTest (org.apache.jackrabbit.oak.spi.security.authentication.external.AbstractExternalAuthTest)2 ValidatorProvider (org.apache.jackrabbit.oak.spi.commit.ValidatorProvider)1