Search in sources :

Example 1 with BuildTriggerStep

use of org.jenkinsci.plugins.workflow.support.steps.build.BuildTriggerStep in project workflow-cps-plugin by jenkinsci.

the class SnippetizerTest method buildTriggerStep.

@Test
public void buildTriggerStep() throws Exception {
    BuildTriggerStep step = new BuildTriggerStep("downstream");
    st.assertRoundTrip(step, "build 'downstream'");
    step.setParameters(Arrays.asList(new StringParameterValue("branch", "default"), new BooleanParameterValue("correct", true)));
    if (StringParameterDefinition.DescriptorImpl.class.isAnnotationPresent(Symbol.class)) {
        st.assertRoundTrip(step, "build job: 'downstream', parameters: [string(name: 'branch', value: 'default'), booleanParam(name: 'correct', value: true)]");
    } else {
        // TODO 2.x delete
        st.assertRoundTrip(step, "build job: 'downstream', parameters: [[$class: 'StringParameterValue', name: 'branch', value: 'default'], [$class: 'BooleanParameterValue', name: 'correct', value: true]]");
    }
}
Also used : StringParameterDefinition(hudson.model.StringParameterDefinition) BooleanParameterValue(hudson.model.BooleanParameterValue) StringParameterValue(hudson.model.StringParameterValue) BuildTriggerStep(org.jenkinsci.plugins.workflow.support.steps.build.BuildTriggerStep) Test(org.junit.Test)

Aggregations

BooleanParameterValue (hudson.model.BooleanParameterValue)1 StringParameterDefinition (hudson.model.StringParameterDefinition)1 StringParameterValue (hudson.model.StringParameterValue)1 BuildTriggerStep (org.jenkinsci.plugins.workflow.support.steps.build.BuildTriggerStep)1 Test (org.junit.Test)1