use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.
the class InternalSecurityProviderTest method testSetAuthorizationConfiguration.
@Test
public void testSetAuthorizationConfiguration() {
AuthorizationConfiguration ac = Mockito.mock(AuthorizationConfiguration.class);
when(ac.getParameters()).thenReturn(PARAMS);
securityProvider.setAuthorizationConfiguration(ac);
assertSame(ac, securityProvider.getConfiguration(AuthorizationConfiguration.class));
for (SecurityConfiguration sc : securityProvider.getConfigurations()) {
if (sc instanceof AuthorizationConfiguration) {
assertSame(ac, sc);
}
}
assertEquals(PARAMS, securityProvider.getParameters(AuthorizationConfiguration.NAME));
}
use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.
the class SecurityProviderRegistrationTest method mockConfiguration.
private static <T> T mockConfiguration(Class<? extends SecurityConfiguration> cl) {
SecurityConfiguration sc = Mockito.mock(cl);
when(sc.getContext()).thenReturn(new ContextImpl());
when(sc.getParameters()).thenReturn(ConfigurationParameters.EMPTY);
return (T) sc;
}
use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.
the class ConfigurationInitializerTest method testInitNonBaseConfiguration.
@Test
public void testInitNonBaseConfiguration() {
SecurityConfiguration sc = new SecurityConfiguration.Default();
ConfigurationInitializer.initializeConfiguration(sp, sc);
assertFalse(sc.getParameters().containsKey("key"));
}
use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.
the class ConfigurationInitializerTest method testInitBaseConfigurationWithParamReturnsSame.
@Test
public void testInitBaseConfigurationWithParamReturnsSame() {
SecurityConfiguration sc = new TestConfiguration();
assertSame(sc, ConfigurationInitializer.initializeConfiguration(sp, sc, params));
}
use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.
the class InternalSecurityProviderTest method testSetAuthenticationConfiguration.
@Test
public void testSetAuthenticationConfiguration() {
AuthenticationConfiguration ac = Mockito.mock(AuthenticationConfiguration.class);
when(ac.getParameters()).thenReturn(PARAMS);
securityProvider.setAuthenticationConfiguration(ac);
assertSame(ac, securityProvider.getConfiguration(AuthenticationConfiguration.class));
for (SecurityConfiguration sc : securityProvider.getConfigurations()) {
if (sc instanceof AuthenticationConfiguration) {
assertSame(ac, sc);
}
}
assertEquals(PARAMS, securityProvider.getParameters(AuthenticationConfiguration.NAME));
}
Aggregations