Search in sources :

Example 11 with User

use of org.jenkinsci.test.acceptance.po.User in project acceptance-test-harness by jenkinsci.

the class LdapPluginTest method custom_invalid_group_membership_filter.

@Test
public void custom_invalid_group_membership_filter() {
    // Given
    useLdapAsSecurityRealm(createDefaults(ldap.get()).groupMembershipStrategy(SearchForGroupsLdapGroupMembershipStrategy.class).groupMembershipStrategyParam("(member={0})"));
    // When
    Login login = jenkins.login();
    login.doLogin("jenkins", "root");
    User userJenkins = new User(jenkins, "jenkins");
    // Then
    assertThat(userJenkins, not(isMemberOf("ldap1")));
    assertThat(userJenkins, not(isMemberOf("ldap2")));
}
Also used : User(org.jenkinsci.test.acceptance.po.User) Login(org.jenkinsci.test.acceptance.po.Login) Test(org.junit.Test)

Example 12 with User

use of org.jenkinsci.test.acceptance.po.User in project acceptance-test-harness by jenkinsci.

the class LdapPluginTest method resolve_email.

@Test
public void resolve_email() {
    // Given
    useLdapAsSecurityRealm(createDefaults(ldap.get()));
    // When
    Login login = jenkins.login();
    login.doLogin("jenkins", "root");
    // Then
    assertThat(jenkins, hasLoggedInUser("jenkins"));
    User u = new User(jenkins, "jenkins");
    assertThat(u, mailAddressIs("jenkins@jenkins-ci.org"));
}
Also used : User(org.jenkinsci.test.acceptance.po.User) Login(org.jenkinsci.test.acceptance.po.Login) Test(org.junit.Test)

Example 13 with User

use of org.jenkinsci.test.acceptance.po.User in project acceptance-test-harness by jenkinsci.

the class LdapPluginTest method custom_display_name.

@Test
@Issue("JENKINS-18355")
public void custom_display_name() {
    // Given
    useLdapAsSecurityRealm(createDefaults(ldap.get()).displayNameAttributeName("cn"));
    // When
    Login login = jenkins.login();
    login.doLogin("jenkins", "root");
    User userJenkins = new User(jenkins, "jenkins");
    // Then
    assertThat(userJenkins, fullNameIs("Jenkins the Butler"));
}
Also used : User(org.jenkinsci.test.acceptance.po.User) Login(org.jenkinsci.test.acceptance.po.Login) Issue(org.jvnet.hudson.test.Issue) Test(org.junit.Test)

Aggregations

User (org.jenkinsci.test.acceptance.po.User)13 Test (org.junit.Test)13 Login (org.jenkinsci.test.acceptance.po.Login)10 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)3 SmokeTest (org.jenkinsci.test.acceptance.junit.SmokeTest)2 Issue (org.jvnet.hudson.test.Issue)2 LdapDetails (org.jenkinsci.test.acceptance.plugins.ldap.LdapDetails)1 MockSecurityRealm (org.jenkinsci.test.acceptance.plugins.mock_security_realm.MockSecurityRealm)1 GlobalSecurityConfig (org.jenkinsci.test.acceptance.po.GlobalSecurityConfig)1