use of hudson.plugins.active_directory.ActiveDirectorySecurityRealm in project configuration-as-code-plugin by jenkinsci.
the class ActiveDirectoryTest method configure_active_directory.
@Test
@ConfiguredWithReadme("active-directory/README.md")
public void configure_active_directory() {
final Jenkins jenkins = Jenkins.get();
final ActiveDirectorySecurityRealm realm = (ActiveDirectorySecurityRealm) jenkins.getSecurityRealm();
assertEquals(1, realm.domains.size());
final ActiveDirectoryDomain domain = realm.domains.get(0);
assertEquals("acme", domain.name);
assertEquals("admin", domain.bindName);
assertEquals("ADMIN123", domain.bindPassword.getPlainText());
assertEquals("ad1.acme.com:123,ad2.acme.com:456", domain.servers);
assertEquals("jenkins", realm.getJenkinsInternalUser());
assertTrue(realm.removeIrrelevantGroups);
assertTrue(realm.startTls);
assertNotNull(realm.getCache());
assertEquals(500, realm.getCache().getSize());
assertEquals(600, realm.getCache().getTtl());
}
use of hudson.plugins.active_directory.ActiveDirectorySecurityRealm in project configuration-as-code-plugin by jenkinsci.
the class ActiveDirectoryTest method configure_active_directory.
@Test
@ConfiguredWithCode(value = "ActiveDirectoryTest.yml")
public void configure_active_directory() throws Exception {
final Jenkins jenkins = Jenkins.getInstance();
final ActiveDirectorySecurityRealm realm = (ActiveDirectorySecurityRealm) jenkins.getSecurityRealm();
assertEquals(1, realm.domains.size());
final ActiveDirectoryDomain domain = realm.domains.get(0);
assertEquals("acme", domain.name);
assertEquals("admin", domain.bindName);
assertEquals("ADMIN123", domain.bindPassword.getPlainText());
assertEquals("ad1.acme.com:123,ad2.acme.com:456", domain.servers);
assertTrue(realm.removeIrrelevantGroups);
assertTrue(realm.startTls);
}
Aggregations