Search in sources :

Example 1 with ActiveDirectoryDomain

use of hudson.plugins.active_directory.ActiveDirectoryDomain 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);
}
Also used : Jenkins(jenkins.model.Jenkins) ActiveDirectorySecurityRealm(hudson.plugins.active_directory.ActiveDirectorySecurityRealm) ActiveDirectoryDomain(hudson.plugins.active_directory.ActiveDirectoryDomain) Test(org.junit.Test) ConfiguredWithCode(org.jenkinsci.plugins.casc.misc.ConfiguredWithCode)

Aggregations

ActiveDirectoryDomain (hudson.plugins.active_directory.ActiveDirectoryDomain)1 ActiveDirectorySecurityRealm (hudson.plugins.active_directory.ActiveDirectorySecurityRealm)1 Jenkins (jenkins.model.Jenkins)1 ConfiguredWithCode (org.jenkinsci.plugins.casc.misc.ConfiguredWithCode)1 Test (org.junit.Test)1