Skip to content

Commit

Permalink
Merge pull request #672 from basil/test
Browse files Browse the repository at this point in the history
Remove unnecessary test method
  • Loading branch information
jglick committed Jan 3, 2024
2 parents 04286e2 + ff2df23 commit f921b4e
Showing 1 changed file with 3 additions and 15 deletions.
Expand Up @@ -39,9 +39,7 @@
import hudson.triggers.SCMTrigger;
import hudson.triggers.TimerTrigger;
import hudson.triggers.Trigger;
import hudson.util.VersionNumber;
import jenkins.model.BuildDiscarderProperty;
import jenkins.model.Jenkins;
import jenkins.model.OptionalJobProperty;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
Expand Down Expand Up @@ -150,16 +148,6 @@ public void simpleInput() throws Exception {
"}");
}

// TODO: Remove once we move to a baseline of 2.281 or later
private String trimParamOrEmpty() {
if (Jenkins.getVersion().isNewerThanOrEqualTo(new VersionNumber("2.281"))) {
return "";
}
else {
return ", trim: false";
}
}

@Test
public void fullInput() throws Exception {
InputDirective input = new InputDirective("hello");
Expand All @@ -180,7 +168,7 @@ public void fullInput() throws Exception {
" submitterParameter 'subParam'\n" +
" parameters {\n" +
// StringParameterDefinition added trim field in 2.90
" string defaultValue: 'steve', description: 'Hey, a string', name: 'aString'" + trimParamOrEmpty() + "\n" +
" string defaultValue: 'steve', description: 'Hey, a string', name: 'aString'\n" +
" booleanParam defaultValue: true, description: 'A boolean now', name: 'aBool'\n" +
" }\n" +
"}");
Expand Down Expand Up @@ -394,7 +382,7 @@ public void parametersSingle() throws Exception {
ParametersDirective params = new ParametersDirective(p);

dg.assertGenerateDirective(params, "parameters {\n" +
" string defaultValue: 'some default', description: 'Hey, a description with a \\' in it.', name: 'SOME_STRING'" + trimParamOrEmpty() + "\n" +
" string defaultValue: 'some default', description: 'Hey, a description with a \\' in it.', name: 'SOME_STRING'\n" +
"}");
}

Expand All @@ -407,7 +395,7 @@ public void parametersMultiple() throws Exception {
ParametersDirective params = new ParametersDirective(p);

dg.assertGenerateDirective(params, "parameters {\n" +
" string defaultValue: 'some default', description: 'Hey, a description with a \\' in it.', name: 'SOME_STRING'" + trimParamOrEmpty() + "\n" +
" string defaultValue: 'some default', description: 'Hey, a description with a \\' in it.', name: 'SOME_STRING'\n" +
" booleanParam defaultValue: true, description: 'This will default to true.', name: 'SOME_BOOL'\n" +
"}");
}
Expand Down

0 comments on commit f921b4e

Please sign in to comment.