use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.
the class SecurityProviderImplTest method testBindUserConfiguration.
@Test
public void testBindUserConfiguration() {
UserConfiguration uc = Mockito.mock(UserConfiguration.class);
securityProvider.bindUserConfiguration(uc);
assertSame(uc, securityProvider.getConfiguration(UserConfiguration.class));
for (SecurityConfiguration sc : securityProvider.getConfigurations()) {
if (sc instanceof UserConfiguration) {
assertSame(uc, sc);
}
}
}
use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.
the class ConfigurationInitializerTest method testInitCompositeBaseConfiguration.
@Test
public void testInitCompositeBaseConfiguration() {
TestComposite<TestConfiguration> composite = new TestComposite<TestConfiguration>();
composite.addConfiguration(new TestConfiguration());
composite.addConfiguration(new TestConfiguration());
ConfigurationInitializer.initializeConfigurations(sp, composite, params);
// verify securityprovider
assertSame(sp, composite.getSecurityProvider());
// verify params
for (SecurityConfiguration sc : composite.getConfigurations()) {
ConfigurationParameters parameters = sc.getParameters();
assertTrue(parameters.containsKey("key"));
assertTrue(parameters.containsKey("key2"));
assertEquals("value", parameters.get("key"));
assertEquals("initialValue", parameters.get("key2"));
}
}
use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.
the class InternalSecurityProviderTest method testSetTokenConfiguration.
@Test
public void testSetTokenConfiguration() {
TokenConfiguration tc = Mockito.mock(TokenConfiguration.class);
when(tc.getParameters()).thenReturn(PARAMS);
securityProvider.setTokenConfiguration(tc);
assertSame(tc, securityProvider.getConfiguration(TokenConfiguration.class));
for (SecurityConfiguration sc : securityProvider.getConfigurations()) {
if (sc instanceof TokenConfiguration) {
assertSame(tc, sc);
}
}
assertEquals(PARAMS, securityProvider.getParameters(TokenConfiguration.NAME));
}
use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.
the class ConfigurationInitializerTest method testInitBaseConfigurationWithParam.
@Test
public void testInitBaseConfigurationWithParam() {
TestConfiguration sc = new TestConfiguration();
SecurityConfiguration afterInit = ConfigurationInitializer.initializeConfiguration(sp, sc, params);
assertSame(sc, afterInit);
// verify securityprovider
assertSame(sp, sc.getSecurityProvider());
// verify params
ConfigurationParameters parameters = afterInit.getParameters();
assertTrue(parameters.containsKey("key"));
assertTrue(parameters.containsKey("key2"));
assertEquals("value", parameters.get("key"));
assertEquals("initialValue", parameters.get("key2"));
}
use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.
the class ConfigurationInitializerTest method testInitBaseConfigurationReturnsSame.
@Test
public void testInitBaseConfigurationReturnsSame() {
SecurityConfiguration sc = new TestConfiguration();
assertSame(sc, ConfigurationInitializer.initializeConfiguration(sp, sc));
}
Aggregations