11
11
import java .util .List ;
12
12
import net .sf .json .JSONObject ;
13
13
import org .jenkinsci .plugins .workflow .job .WorkflowRun ;
14
- import org .junit .Rule ;
15
- import org .junit .Test ;
14
+ import org .junit .jupiter .api .Test ;
16
15
import org .jvnet .hudson .test .Issue ;
17
16
import org .jvnet .hudson .test .JenkinsRule ;
17
+ import org .jvnet .hudson .test .junit .jupiter .WithJenkins ;
18
18
19
- public class PipelineConsoleViewActionTest {
20
- @ Rule
21
- public JenkinsRule j = new JenkinsRule ();
19
+ @ WithJenkins
20
+ class PipelineConsoleViewActionTest {
22
21
23
22
private static final String TEXT = "Hello, World!" + System .lineSeparator ();
24
23
25
24
@ Issue ("GH#224" )
26
25
@ Test
27
- public void getConsoleLogReturnLogText () throws Exception {
26
+ void getConsoleLogReturnLogText (JenkinsRule j ) throws Exception {
28
27
WorkflowRun run = TestUtils .createAndRunJob (
29
28
j , "hello_world_scripted" , "helloWorldScriptedPipeline.jenkinsfile" , Result .SUCCESS );
30
29
@@ -43,7 +42,7 @@ public void getConsoleLogReturnLogText() throws Exception {
43
42
44
43
@ Issue ("GH#224" )
45
44
@ Test
46
- public void getConsoleLogReturnsErrorText () throws Exception {
45
+ void getConsoleLogReturnsErrorText (JenkinsRule j ) throws Exception {
47
46
WorkflowRun run =
48
47
TestUtils .createAndRunJob (j , "hello_world_scripted" , "simpleError.jenkinsfile" , Result .FAILURE );
49
48
@@ -61,7 +60,7 @@ public void getConsoleLogReturnsErrorText() throws Exception {
61
60
62
61
@ Issue ("GH#224" )
63
62
@ Test
64
- public void getConsoleLogReturnLogTextWithOffset () throws Exception {
63
+ void getConsoleLogReturnLogTextWithOffset (JenkinsRule j ) throws Exception {
65
64
WorkflowRun run = TestUtils .createAndRunJob (
66
65
j , "hello_world_scripted" , "helloWorldScriptedPipeline.jenkinsfile" , Result .SUCCESS );
67
66
@@ -80,7 +79,7 @@ public void getConsoleLogReturnLogTextWithOffset() throws Exception {
80
79
81
80
@ Issue ("GH#224" )
82
81
@ Test
83
- public void getConsoleLogReturnLogTextWithNegativeOffset () throws Exception {
82
+ void getConsoleLogReturnLogTextWithNegativeOffset (JenkinsRule j ) throws Exception {
84
83
WorkflowRun run = TestUtils .createAndRunJob (
85
84
j , "hello_world_scripted" , "helloWorldScriptedPipeline.jenkinsfile" , Result .SUCCESS );
86
85
@@ -101,7 +100,7 @@ public void getConsoleLogReturnLogTextWithNegativeOffset() throws Exception {
101
100
102
101
@ Issue ("GH#224" )
103
102
@ Test
104
- public void getConsoleLogReturnLogTextWithLargeNegativeOffset () throws Exception {
103
+ void getConsoleLogReturnLogTextWithLargeNegativeOffset (JenkinsRule j ) throws Exception {
105
104
WorkflowRun run = TestUtils .createAndRunJob (
106
105
j , "hello_world_scripted" , "helloWorldScriptedPipeline.jenkinsfile" , Result .SUCCESS );
107
106
@@ -120,7 +119,7 @@ public void getConsoleLogReturnLogTextWithLargeNegativeOffset() throws Exception
120
119
121
120
@ Issue ("GH#224" )
122
121
@ Test
123
- public void getConsoleLogReturnLogTextWithLargeOffset () throws Exception {
122
+ void getConsoleLogReturnLogTextWithLargeOffset (JenkinsRule j ) throws Exception {
124
123
WorkflowRun run = TestUtils .createAndRunJob (
125
124
j , "hello_world_scripted" , "helloWorldScriptedPipeline.jenkinsfile" , Result .SUCCESS );
126
125
@@ -137,7 +136,7 @@ public void getConsoleLogReturnLogTextWithLargeOffset() throws Exception {
137
136
138
137
@ Issue ("GH#224" )
139
138
@ Test
140
- public void getConsoleLogOfStepWithOutputAndException () throws Exception {
139
+ void getConsoleLogOfStepWithOutputAndException (JenkinsRule j ) throws Exception {
141
140
WorkflowRun run =
142
141
TestUtils .createAndRunJob (j , "exec_returns_error" , "execStepReturnsError.jenkinsfile" , Result .FAILURE );
143
142
PipelineNodeGraphAdapter builder = new PipelineNodeGraphAdapter (run );
0 commit comments