Skip to content

Commit

Permalink
Use multiline string in test
Browse files Browse the repository at this point in the history
Java 17 feature that makes code more readable

Thanks to OpenRewrite
  • Loading branch information
MarkEWaite committed Dec 16, 2024
1 parent 7f1d2e6 commit 4a608ac
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/test/java/hudson/tasks/JavadocArchiverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ public void doNotKeepAll() throws Exception {
public void keepAllInPipeline() throws Exception {
WorkflowJob job = r.createProject(WorkflowJob.class);
job.setDefinition(new CpsFlowDefinition(
"node {\n"
+ " writeFile text: 'generated by #'+env.BUILD_NUMBER, file: 'doc/index.html'\n"
+ " javadoc javadocDir: 'doc', keepAll: true\n"
+ "}",
"""
node {
writeFile text: 'generated by #'+env.BUILD_NUMBER, file: 'doc/index.html'
javadoc javadocDir: 'doc', keepAll: true
}
""",
true));

WorkflowRun b1 = r.buildAndAssertSuccess(job);
Expand All @@ -119,10 +121,12 @@ public void keepAllInPipeline() throws Exception {
public void doNotKeepAllInPipeline() throws Exception {
WorkflowJob job = r.createProject(WorkflowJob.class);
job.setDefinition(new CpsFlowDefinition(
"node {\n"
+ " writeFile text: 'generated by #'+env.BUILD_NUMBER, file: 'doc/index.html'\n"
+ " javadoc javadocDir: 'doc', keepAll: false\n"
+ "}",
"""
node {
writeFile text: 'generated by #'+env.BUILD_NUMBER, file: 'doc/index.html'
javadoc javadocDir: 'doc', keepAll: false
}
""",
true));

WorkflowRun b1 = r.buildAndAssertSuccess(job);
Expand Down

0 comments on commit 4a608ac

Please sign in to comment.