1111import java .util .List ;
1212import net .sf .json .JSONObject ;
1313import org .jenkinsci .plugins .workflow .job .WorkflowRun ;
14- import org .junit .Rule ;
15- import org .junit .Test ;
14+ import org .junit .jupiter .api .Test ;
1615import org .jvnet .hudson .test .Issue ;
1716import org .jvnet .hudson .test .JenkinsRule ;
17+ import org .jvnet .hudson .test .junit .jupiter .WithJenkins ;
1818
19- public class PipelineConsoleViewActionTest {
20- @ Rule
21- public JenkinsRule j = new JenkinsRule ();
19+ @ WithJenkins
20+ class PipelineConsoleViewActionTest {
2221
2322 private static final String TEXT = "Hello, World!" + System .lineSeparator ();
2423
2524 @ Issue ("GH#224" )
2625 @ Test
27- public void getConsoleLogReturnLogText () throws Exception {
26+ void getConsoleLogReturnLogText (JenkinsRule j ) throws Exception {
2827 WorkflowRun run = TestUtils .createAndRunJob (
2928 j , "hello_world_scripted" , "helloWorldScriptedPipeline.jenkinsfile" , Result .SUCCESS );
3029
@@ -43,7 +42,7 @@ public void getConsoleLogReturnLogText() throws Exception {
4342
4443 @ Issue ("GH#224" )
4544 @ Test
46- public void getConsoleLogReturnsErrorText () throws Exception {
45+ void getConsoleLogReturnsErrorText (JenkinsRule j ) throws Exception {
4746 WorkflowRun run =
4847 TestUtils .createAndRunJob (j , "hello_world_scripted" , "simpleError.jenkinsfile" , Result .FAILURE );
4948
@@ -61,7 +60,7 @@ public void getConsoleLogReturnsErrorText() throws Exception {
6160
6261 @ Issue ("GH#224" )
6362 @ Test
64- public void getConsoleLogReturnLogTextWithOffset () throws Exception {
63+ void getConsoleLogReturnLogTextWithOffset (JenkinsRule j ) throws Exception {
6564 WorkflowRun run = TestUtils .createAndRunJob (
6665 j , "hello_world_scripted" , "helloWorldScriptedPipeline.jenkinsfile" , Result .SUCCESS );
6766
@@ -80,7 +79,7 @@ public void getConsoleLogReturnLogTextWithOffset() throws Exception {
8079
8180 @ Issue ("GH#224" )
8281 @ Test
83- public void getConsoleLogReturnLogTextWithNegativeOffset () throws Exception {
82+ void getConsoleLogReturnLogTextWithNegativeOffset (JenkinsRule j ) throws Exception {
8483 WorkflowRun run = TestUtils .createAndRunJob (
8584 j , "hello_world_scripted" , "helloWorldScriptedPipeline.jenkinsfile" , Result .SUCCESS );
8685
@@ -101,7 +100,7 @@ public void getConsoleLogReturnLogTextWithNegativeOffset() throws Exception {
101100
102101 @ Issue ("GH#224" )
103102 @ Test
104- public void getConsoleLogReturnLogTextWithLargeNegativeOffset () throws Exception {
103+ void getConsoleLogReturnLogTextWithLargeNegativeOffset (JenkinsRule j ) throws Exception {
105104 WorkflowRun run = TestUtils .createAndRunJob (
106105 j , "hello_world_scripted" , "helloWorldScriptedPipeline.jenkinsfile" , Result .SUCCESS );
107106
@@ -120,7 +119,7 @@ public void getConsoleLogReturnLogTextWithLargeNegativeOffset() throws Exception
120119
121120 @ Issue ("GH#224" )
122121 @ Test
123- public void getConsoleLogReturnLogTextWithLargeOffset () throws Exception {
122+ void getConsoleLogReturnLogTextWithLargeOffset (JenkinsRule j ) throws Exception {
124123 WorkflowRun run = TestUtils .createAndRunJob (
125124 j , "hello_world_scripted" , "helloWorldScriptedPipeline.jenkinsfile" , Result .SUCCESS );
126125
@@ -137,7 +136,7 @@ public void getConsoleLogReturnLogTextWithLargeOffset() throws Exception {
137136
138137 @ Issue ("GH#224" )
139138 @ Test
140- public void getConsoleLogOfStepWithOutputAndException () throws Exception {
139+ void getConsoleLogOfStepWithOutputAndException (JenkinsRule j ) throws Exception {
141140 WorkflowRun run =
142141 TestUtils .createAndRunJob (j , "exec_returns_error" , "execStepReturnsError.jenkinsfile" , Result .FAILURE );
143142 PipelineNodeGraphAdapter builder = new PipelineNodeGraphAdapter (run );
0 commit comments