Search in sources :

Example 6 with User

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

the class LdapPluginTest method custom_mail_filter.

@Test
public void custom_mail_filter() {
    // Given
    useLdapAsSecurityRealm(createDefaults(ldap.get()).mailAdressAttributeName("givenName"));
    // When
    Login login = jenkins.login();
    login.doLogin("jenkins", "root");
    User userJenkins = new User(jenkins, "jenkins");
    // Then
    assertThat(userJenkins, mailAddressIs("givenname@mailaddress.com"));
}
Also used : User(org.jenkinsci.test.acceptance.po.User) Login(org.jenkinsci.test.acceptance.po.Login) Test(org.junit.Test)

Example 7 with User

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

the class JenkinsDatabaseSecurityRealmTest method login_and_logout.

@Test
public // @Category(SmokeTest.class)
void login_and_logout() {
    User user = realm.signup().fullname(FULL_NAME).email(EMAIL).password(PWD).signup(NAME);
    jenkins.login().doLogin(user.id(), PWD);
    assertEquals(user, jenkins.getCurrentUser());
    jenkins.logout();
    assertEquals(null, jenkins.getCurrentUser().id());
}
Also used : User(org.jenkinsci.test.acceptance.po.User) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) SmokeTest(org.jenkinsci.test.acceptance.junit.SmokeTest)

Example 8 with User

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

the class LdapPluginTest method resolve_group_memberships_with_defaults.

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

Example 9 with User

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

the class LdapPluginTest method resolve_group_memberships_with_defaults_negative.

@Test
public void resolve_group_memberships_with_defaults_negative() {
    // Given
    useLdapAsSecurityRealm(createDefaults(ldap.get()));
    // When
    Login login = jenkins.login();
    login.doLogin("homer", "cisco");
    User homer = new User(jenkins, "homer");
    // Then
    assertThat(homer, isMemberOf("ldap2"));
    assertThat(homer, not(isMemberOf("ldap1")));
}
Also used : User(org.jenkinsci.test.acceptance.po.User) Login(org.jenkinsci.test.acceptance.po.Login) Test(org.junit.Test)

Example 10 with User

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

the class LdapPluginTest method resolve_display_name_with_defaults.

@Test
@Issue("JENKINS-18355")
public void resolve_display_name_with_defaults() {
    // Given
    useLdapAsSecurityRealm(createDefaults(ldap.get()));
    // When
    Login login = jenkins.login();
    login.doLogin("jenkins", "root");
    User userJenkins = new User(jenkins, "jenkins");
    // Then
    assertThat(userJenkins, fullNameIs("Jenkins displayname"));
}
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