use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.
the class SecurityProviderImplTest method testBindPrivilegeConfiguration.
@Test
public void testBindPrivilegeConfiguration() {
PrivilegeConfiguration pc = Mockito.mock(PrivilegeConfiguration.class);
securityProvider.bindPrivilegeConfiguration(pc);
assertSame(pc, securityProvider.getConfiguration(PrivilegeConfiguration.class));
for (SecurityConfiguration sc : securityProvider.getConfigurations()) {
if (sc instanceof PrivilegeConfiguration) {
assertSame(pc, sc);
}
}
}
use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.
the class SecurityProviderImplTest method testUnBindPrivilegeConfiguration.
@Test
public void testUnBindPrivilegeConfiguration() {
PrivilegeConfiguration pc = Mockito.mock(PrivilegeConfiguration.class);
securityProvider.bindPrivilegeConfiguration(pc);
securityProvider.unbindPrivilegeConfiguration(pc);
assertNull(securityProvider.getConfiguration(PrivilegeConfiguration.class));
for (SecurityConfiguration sc : securityProvider.getConfigurations()) {
if (sc instanceof PrivilegeConfiguration) {
fail();
}
}
}
use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.
the class ConfigurationInitializerTest method testInitConfigurationWithParamReturnsSame.
@Test
public void testInitConfigurationWithParamReturnsSame() {
SecurityConfiguration sc = new SecurityConfiguration.Default();
assertSame(sc, ConfigurationInitializer.initializeConfiguration(sp, sc, params));
}
use of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration in project jackrabbit-oak by apache.
the class ConfigurationInitializerTest method testInitBaseConfiguration.
@Test
public void testInitBaseConfiguration() {
TestConfiguration sc = new TestConfiguration();
SecurityConfiguration afterInit = ConfigurationInitializer.initializeConfiguration(sp, sc);
assertSame(sc, afterInit);
// verify securityprovider
assertSame(sp, sc.getSecurityProvider());
// verify params
ConfigurationParameters parameters = afterInit.getParameters();
assertTrue(parameters.containsKey("key"));
assertTrue(parameters.containsKey("key2"));
assertEquals("initialValue", 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 testInitConfigurationReturnsSame.
@Test
public void testInitConfigurationReturnsSame() {
SecurityConfiguration sc = new SecurityConfiguration.Default();
assertSame(sc, ConfigurationInitializer.initializeConfiguration(sp, sc));
}
Aggregations