Skip to content

Commit

Permalink
Fix test for future versions of jenkins - PCT failures (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
res0nance authored May 10, 2021
1 parent 931ce7a commit 6dd4a21
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
import hudson.plugins.git.UserMergeOptions;
import hudson.plugins.git.extensions.impl.CleanBeforeCheckout;
import java.util.HashMap;

import hudson.util.VersionNumber;
import jenkins.model.Jenkins;
import org.codehaus.groovy.runtime.GStringImpl;
import org.hamcrest.Matchers;
import org.jenkinsci.plugins.structs.Fishing;
Expand Down Expand Up @@ -647,9 +650,15 @@ public static final class TakesParams {
}

@Test public void parametersDefinitionProperty() throws Exception {
roundTrip(ParametersDefinitionProperty.class, map("parameterDefinitions", Arrays.asList(
map(CLAZZ, "BooleanParameterDefinition", "name", "flag", "defaultValue", false),
map(CLAZZ, "StringParameterDefinition", "name", "text", "trim", false))));
if (Jenkins.getVersion().isNewerThanOrEqualTo(new VersionNumber("2.281"))) {
roundTrip(ParametersDefinitionProperty.class, map("parameterDefinitions", Arrays.asList(
map(CLAZZ, "BooleanParameterDefinition", "name", "flag"),
map(CLAZZ, "StringParameterDefinition", "name", "text"))));
} else {
roundTrip(ParametersDefinitionProperty.class, map("parameterDefinitions", Arrays.asList(
map(CLAZZ, "BooleanParameterDefinition", "name", "flag", "defaultValue", false),
map(CLAZZ, "StringParameterDefinition", "name", "text", "trim", false))));
}
}

@Issue("JENKINS-26619")
Expand Down

0 comments on commit 6dd4a21

Please sign in to comment.