Skip to content

Commit ec6aec9

Browse files
Migrate tests to JUnit5
* Use JUnit5 annotations and imports * Cleanup assertions * Remove public visibility from test classes and methods
1 parent 3c94f32 commit ec6aec9

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/test/java/hudson/plugins/jira/JiraBuildActionTest.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,29 @@
22

33
import static org.hamcrest.MatcherAssert.assertThat;
44
import static org.hamcrest.Matchers.is;
5-
import static org.junit.Assert.assertEquals;
5+
import static org.junit.jupiter.api.Assertions.assertEquals;
66

77
import hudson.model.Job;
88
import hudson.model.Run;
9-
import org.junit.Rule;
10-
import org.junit.Test;
9+
import org.junit.jupiter.api.Test;
1110
import org.jvnet.hudson.test.JenkinsRule;
11+
import org.jvnet.hudson.test.junit.jupiter.WithJenkins;
1212
import org.jvnet.hudson.test.recipes.LocalData;
1313

1414
/**
1515
* Place needed resources in src/test/resources
1616
*
1717
*/
18-
public class JiraBuildActionTest {
19-
20-
@Rule
21-
public JenkinsRule r = new JenkinsRule();
18+
class JiraBuildActionTest {
2219

2320
/**
2421
* Test if existing serialized JiraBuildAction information will be loaded after upgrading jira
2522
* plugin version to with new JiraBuildAction class version introduced in PR-72.
2623
*/
2724
@Test
2825
@LocalData
29-
public void binaryCompatibility() {
26+
@WithJenkins
27+
void binaryCompatibility(JenkinsRule r) throws Exception {
3028
assertEquals("Jenkins JiraBuildActionTest config", r.jenkins.getSystemMessage());
3129

3230
Job job = r.getInstance().getItemByFullName("/project", Job.class);

0 commit comments

Comments
 (0)