Search in sources :

Example 1 with OwnershipGlobalConfig

use of org.jenkinsci.test.acceptance.plugins.ownership.OwnershipGlobalConfig in project acceptance-test-harness by jenkinsci.

the class OwnershipPluginTest method implicitly_set_job_ownership.

@Test
@Since("1.509")
public void implicitly_set_job_ownership() {
    GlobalSecurityConfig security = new GlobalSecurityConfig(jenkins);
    security.configure();
    JenkinsDatabaseSecurityRealm realm = security.useRealm(JenkinsDatabaseSecurityRealm.class);
    realm.allowUsersToSignUp(true);
    security.save();
    final JenkinsConfig globalConfig = jenkins.getConfigPage();
    globalConfig.configure();
    new OwnershipGlobalConfig(globalConfig).setImplicitJobOwnership();
    globalConfig.save();
    User user = realm.signup("jenkins-acceptance-tests-user");
    jenkins.login().doLogin(user);
    FreeStyleJob job = jenkins.jobs.create();
    job.save();
    elasticSleep(1000);
    assertThat(job, ownedBy(user));
}
Also used : OwnershipGlobalConfig(org.jenkinsci.test.acceptance.plugins.ownership.OwnershipGlobalConfig) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) Since(org.jenkinsci.test.acceptance.junit.Since)

Aggregations

AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)1 Since (org.jenkinsci.test.acceptance.junit.Since)1 OwnershipGlobalConfig (org.jenkinsci.test.acceptance.plugins.ownership.OwnershipGlobalConfig)1 Test (org.junit.Test)1