use of org.sonar.api.security.SecurityRealm in project sonarqube by SonarSource.
the class SecurityRealmFactoryTest method should_take_precedence_over_authenticator.
@Test
public void should_take_precedence_over_authenticator() {
SecurityRealm realm = new FakeRealm();
settings.setProperty(CoreProperties.CORE_AUTHENTICATOR_REALM, realm.getName());
LoginPasswordAuthenticator authenticator = new FakeAuthenticator();
settings.setProperty(CoreProperties.CORE_AUTHENTICATOR_CLASS, FakeAuthenticator.class.getName());
SecurityRealmFactory factory = new SecurityRealmFactory(settings, new SecurityRealm[] { realm }, new LoginPasswordAuthenticator[] { authenticator });
assertThat(factory.getRealm()).isSameAs(realm);
}
Aggregations