use of org.apache.jackrabbit.oak.spi.security.authentication.AuthenticationConfiguration 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));
}
use of org.apache.jackrabbit.oak.spi.security.authentication.AuthenticationConfiguration in project jackrabbit-oak by apache.
the class SecurityProviderImplTest method testUnBindAuthenticationConfiguration.
@Test
public void testUnBindAuthenticationConfiguration() {
AuthenticationConfiguration ac = Mockito.mock(AuthenticationConfiguration.class);
securityProvider.bindAuthenticationConfiguration(ac);
securityProvider.unbindAuthenticationConfiguration(ac);
assertNull(securityProvider.getConfiguration(AuthenticationConfiguration.class));
for (SecurityConfiguration sc : securityProvider.getConfigurations()) {
if (sc instanceof AuthenticationConfiguration) {
fail();
}
}
}
use of org.apache.jackrabbit.oak.spi.security.authentication.AuthenticationConfiguration in project jackrabbit-oak by apache.
the class SecurityProviderImplTest method testBindAuthenticationConfiguration.
@Test
public void testBindAuthenticationConfiguration() {
AuthenticationConfiguration ac = Mockito.mock(AuthenticationConfiguration.class);
securityProvider.bindAuthenticationConfiguration(ac);
assertSame(ac, securityProvider.getConfiguration(AuthenticationConfiguration.class));
for (SecurityConfiguration sc : securityProvider.getConfigurations()) {
if (sc instanceof AuthenticationConfiguration) {
assertSame(ac, sc);
}
}
}
use of org.apache.jackrabbit.oak.spi.security.authentication.AuthenticationConfiguration in project jackrabbit-oak by apache.
the class SecurityProviderRegistrationTest method testBindAnotherAuthenticationConfiguration.
@Test
public void testBindAnotherAuthenticationConfiguration() throws Exception {
Field f = registration.getClass().getDeclaredField("authenticationConfiguration");
f.setAccessible(true);
AuthenticationConfiguration ac = mockConfiguration(AuthenticationConfiguration.class);
registration.bindAuthenticationConfiguration(ac);
assertSame(ac, f.get(registration));
AuthenticationConfiguration ac2 = mockConfiguration(AuthenticationConfiguration.class);
registration.bindAuthenticationConfiguration(ac2);
assertSame(ac2, f.get(registration));
}
use of org.apache.jackrabbit.oak.spi.security.authentication.AuthenticationConfiguration in project jackrabbit-oak by apache.
the class SecurityProviderRegistrationTest method testBindUnbindAuthenticationConfiguration.
@Test
public void testBindUnbindAuthenticationConfiguration() throws Exception {
Field f = registration.getClass().getDeclaredField("authenticationConfiguration");
f.setAccessible(true);
assertNull(f.get(registration));
AuthenticationConfiguration ac = mockConfiguration(AuthenticationConfiguration.class);
registration.bindAuthenticationConfiguration(ac);
assertSame(ac, f.get(registration));
registration.unbindAuthenticationConfiguration(ac);
assertNull(f.get(registration));
}
Aggregations