Search in sources :

Example 1 with PasswordParameterDefinition

use of hudson.model.PasswordParameterDefinition in project workflow-cps-plugin by jenkinsci.

the class ParamsVariableTest method smokes.

@Issue("JENKINS-27295")
@Test
public void smokes() throws Exception {
    WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p");
    p.setDefinition(new CpsFlowDefinition("echo(/TEXT=${params.TEXT} FLAG=${params.FLAG ? 'yes' : 'no'} PASS=${params.PASS}/)", true));
    p.addProperty(new ParametersDefinitionProperty(new StringParameterDefinition("TEXT", ""), new BooleanParameterDefinition("FLAG", false, null), new PasswordParameterDefinition("PASS", "", null)));
    WorkflowRun b = r.assertBuildStatusSuccess(p.scheduleBuild2(0, new ParametersAction(new StringParameterValue("TEXT", "hello"), new BooleanParameterValue("FLAG", true), new PasswordParameterValue("PASS", "s3cr3t"))));
    r.assertLogContains("TEXT=hello", b);
    r.assertLogContains("FLAG=yes", b);
    r.assertLogContains("PASS=s3cr3t", b);
}
Also used : StringParameterDefinition(hudson.model.StringParameterDefinition) BooleanParameterDefinition(hudson.model.BooleanParameterDefinition) ParametersDefinitionProperty(hudson.model.ParametersDefinitionProperty) BooleanParameterValue(hudson.model.BooleanParameterValue) PasswordParameterDefinition(hudson.model.PasswordParameterDefinition) StringParameterValue(hudson.model.StringParameterValue) PasswordParameterValue(hudson.model.PasswordParameterValue) WorkflowJob(org.jenkinsci.plugins.workflow.job.WorkflowJob) ParametersAction(hudson.model.ParametersAction) WorkflowRun(org.jenkinsci.plugins.workflow.job.WorkflowRun) Issue(org.jvnet.hudson.test.Issue) Test(org.junit.Test)

Aggregations

BooleanParameterDefinition (hudson.model.BooleanParameterDefinition)1 BooleanParameterValue (hudson.model.BooleanParameterValue)1 ParametersAction (hudson.model.ParametersAction)1 ParametersDefinitionProperty (hudson.model.ParametersDefinitionProperty)1 PasswordParameterDefinition (hudson.model.PasswordParameterDefinition)1 PasswordParameterValue (hudson.model.PasswordParameterValue)1 StringParameterDefinition (hudson.model.StringParameterDefinition)1 StringParameterValue (hudson.model.StringParameterValue)1 WorkflowJob (org.jenkinsci.plugins.workflow.job.WorkflowJob)1 WorkflowRun (org.jenkinsci.plugins.workflow.job.WorkflowRun)1 Test (org.junit.Test)1 Issue (org.jvnet.hudson.test.Issue)1