use of org.apache.jackrabbit.oak.spi.commit.MoveTracker in project jackrabbit-oak by apache.
the class PrivilegeConfigurationImplTest method testGetValidators.
@Test
public void testGetValidators() {
List<? extends ValidatorProvider> l = configuration.getValidators("wspName", ImmutableSet.<Principal>of(), new MoveTracker());
assertEquals(1, l.size());
assertTrue(l.get(0) instanceof PrivilegeValidatorProvider);
}
use of org.apache.jackrabbit.oak.spi.commit.MoveTracker in project jackrabbit-oak by apache.
the class CugConfigurationTest method testGetValidators.
@Test
public void testGetValidators() {
List<? extends ValidatorProvider> l = new CugConfiguration().getValidators("wspName", ImmutableSet.of(), new MoveTracker());
assertEquals(1, l.size());
assertTrue(l.iterator().next() instanceof CugValidatorProvider);
}
use of org.apache.jackrabbit.oak.spi.commit.MoveTracker in project jackrabbit-oak by apache.
the class UserConfigurationImplTest method testValidators.
@Test
public void testValidators() {
UserConfigurationImpl configuration = new UserConfigurationImpl(getSecurityProvider());
configuration.setRootProvider(getRootProvider());
configuration.setTreeProvider(getTreeProvider());
List<? extends ValidatorProvider> validators = configuration.getValidators(adminSession.getWorkspaceName(), Collections.<Principal>emptySet(), new MoveTracker());
assertEquals(2, validators.size());
List<String> clNames = Lists.newArrayList(UserValidatorProvider.class.getName(), CacheValidatorProvider.class.getName());
for (ValidatorProvider vp : validators) {
clNames.remove(vp.getClass().getName());
}
assertTrue(clNames.isEmpty());
}
use of org.apache.jackrabbit.oak.spi.commit.MoveTracker in project jackrabbit-oak by apache.
the class ExternalPrincipalConfigurationTest method testGetValidatorsOmitIdProtection.
@Test
public void testGetValidatorsOmitIdProtection() throws Exception {
externalPrincipalConfiguration.setParameters(ConfigurationParameters.of(ExternalIdentityConstants.PARAM_PROTECT_EXTERNAL_IDS, false));
ContentSession cs = root.getContentSession();
List<? extends ValidatorProvider> validatorProviders = externalPrincipalConfiguration.getValidators(cs.getWorkspaceName(), cs.getAuthInfo().getPrincipals(), new MoveTracker());
assertFalse(validatorProviders.isEmpty());
assertEquals(1, validatorProviders.size());
assertTrue(validatorProviders.get(0) instanceof ExternalIdentityValidatorProvider);
enable();
validatorProviders = externalPrincipalConfiguration.getValidators(cs.getWorkspaceName(), cs.getAuthInfo().getPrincipals(), new MoveTracker());
assertFalse(validatorProviders.isEmpty());
assertEquals(1, validatorProviders.size());
assertTrue(validatorProviders.get(0) instanceof ExternalIdentityValidatorProvider);
}
use of org.apache.jackrabbit.oak.spi.commit.MoveTracker in project jackrabbit-oak by apache.
the class TokenConfigurationImplTest method testGetValidators.
@Test
public void testGetValidators() {
List<? extends ValidatorProvider> validators = tc.getValidators(root.getContentSession().getWorkspaceName(), ImmutableSet.<Principal>of(), new MoveTracker());
assertNotNull(validators);
assertEquals(1, validators.size());
assertTrue(validators.get(0) instanceof TokenValidatorProvider);
}
Aggregations