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 Jan 3, 2025
1 parent cadb868 commit 2e10be0
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 2e10be0

Please sign in to comment.