use of javaposse.jobdsl.plugin.GlobalJobDslSecurityConfiguration in project configuration-as-code-plugin by jenkinsci.
the class SeedJobTest method configure_seed_job_with_security_config.
@Test
@ConfiguredWithCode("SeedJobTest_withSecurityConfig.yml")
@Envs(@Env(name = "SEED_JOB_FOLDER_FILE_PATH", value = "."))
public void configure_seed_job_with_security_config() throws Exception {
final Jenkins jenkins = Jenkins.get();
final GlobalJobDslSecurityConfiguration dslSecurity = GlobalConfiguration.all().get(GlobalJobDslSecurityConfiguration.class);
assertNotNull(dslSecurity);
assertThat("ScriptSecurity", dslSecurity.isUseScriptSecurity(), is(false));
FreeStyleProject seedJobWithSecurityConfig = (FreeStyleProject) jenkins.getItem("seedJobWithSecurityConfig");
assertNotNull(seedJobWithSecurityConfig);
assertTrue(seedJobWithSecurityConfig.isInQueue());
FreeStyleBuild freeStyleBuild = j.buildAndAssertSuccess(seedJobWithSecurityConfig);
j.assertLogContains("Processing DSL script testJob2.groovy", freeStyleBuild);
j.assertLogContains("Added items:", freeStyleBuild);
j.assertLogContains("GeneratedJob{name='testJob2'}", freeStyleBuild);
}
use of javaposse.jobdsl.plugin.GlobalJobDslSecurityConfiguration in project configuration-as-code-plugin by jenkinsci.
the class JobDslGlobaSecurityConfigurationTest method global_dsl_security.
@Test
public void global_dsl_security() throws Exception {
final GlobalJobDslSecurityConfiguration dslSecurity = GlobalConfiguration.all().get(GlobalJobDslSecurityConfiguration.class);
dslSecurity.setUseScriptSecurity(true);
assertThat("ScriptSecurity", dslSecurity.isUseScriptSecurity(), is(true));
TestConfiguration.withCode("JobDslGlobaSecurityConfigurationTest.yml").configure(getClass());
assertThat("ScriptSecurity", dslSecurity.isUseScriptSecurity(), is(false));
}
use of javaposse.jobdsl.plugin.GlobalJobDslSecurityConfiguration in project configuration-as-code-plugin by jenkinsci.
the class JobDslGlobalSecurityConfigurationTest method getGlobalJobDslSecurityConfiguration.
private GlobalJobDslSecurityConfiguration getGlobalJobDslSecurityConfiguration() {
final GlobalJobDslSecurityConfiguration dslSecurity = GlobalConfiguration.all().get(GlobalJobDslSecurityConfiguration.class);
assertNotNull(dslSecurity);
return dslSecurity;
}
Aggregations