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));
}
Aggregations