Skip to content

Commit 461fadf

Browse files
gselzerctrueden
authored andcommitted
Upgrade SciJava Parse2 to JUnit 5
1 parent 8209ee1 commit 461fadf

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

scijava/scijava-parse2/pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,13 @@
103103

104104
<!-- Test scope dependencies -->
105105
<dependency>
106-
<groupId>junit</groupId>
107-
<artifactId>junit</artifactId>
106+
<groupId>org.junit.jupiter</groupId>
107+
<artifactId>junit-jupiter-api</artifactId>
108+
<scope>test</scope>
109+
</dependency>
110+
<dependency>
111+
<groupId>org.junit.jupiter</groupId>
112+
<artifactId>junit-jupiter-engine</artifactId>
108113
<scope>test</scope>
109114
</dependency>
110115
</dependencies>

scijava/scijava-parse2/src/test/java/org/scijava/parse2/impl/ParseServiceTest.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,18 @@
2929

3030
package org.scijava.parse2.impl;
3131

32-
import static org.junit.Assert.assertEquals;
33-
import static org.junit.Assert.assertFalse;
34-
import static org.junit.Assert.assertNull;
35-
import static org.junit.Assert.assertSame;
36-
import static org.junit.Assert.assertTrue;
3732

3833
import java.util.List;
3934
import java.util.Map;
4035

41-
import org.junit.Before;
42-
import org.junit.Test;
36+
import org.junit.jupiter.api.BeforeEach;
37+
import org.junit.jupiter.api.Test;
4338
import org.scijava.parse2.Item;
4439
import org.scijava.parse2.Items;
4540
import org.scijava.parse2.Parser;
4641

42+
import static org.junit.jupiter.api.Assertions.*;
43+
4744
/**
4845
* Tests {@link Parser}.
4946
*
@@ -53,7 +50,7 @@ public class ParseServiceTest {
5350

5451
private Parser parser;
5552

56-
@Before
53+
@BeforeEach
5754
public void setUp() {
5855
parser = new DefaultParser();
5956
}
@@ -123,7 +120,7 @@ private void assertMapCorrect(final Items items) {
123120
// test that map iteration order is the same
124121
int index = 0;
125122
for (final Object value : map.values()) {
126-
assertSame("" + index + ":", items.get(index++).value(), value);
123+
assertSame(items.get(index++).value(), value, "" + index + ":");
127124
}
128125
}
129126

0 commit comments

Comments
 (0)