Issue #23507 tiger-types use junit5 instead of junit4
diff --git a/nucleus/hk2/tiger-types/pom.xml b/nucleus/hk2/tiger-types/pom.xml
index 4823cf1..bb20098 100644
--- a/nucleus/hk2/tiger-types/pom.xml
+++ b/nucleus/hk2/tiger-types/pom.xml
@@ -31,6 +31,17 @@
<name>Tiger types- type arithmetic library for Java5</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest</artifactId>
+ </dependency>
+ </dependencies>
+
<build>
<plugins>
<plugin>
diff --git a/nucleus/hk2/tiger-types/src/test/java/org/jvnet/tiger_types/ListerTest.java b/nucleus/hk2/tiger-types/src/test/java/org/jvnet/tiger_types/ListerTest.java
index 2a86844..42776af 100644
--- a/nucleus/hk2/tiger-types/src/test/java/org/jvnet/tiger_types/ListerTest.java
+++ b/nucleus/hk2/tiger-types/src/test/java/org/jvnet/tiger_types/ListerTest.java
@@ -16,25 +16,34 @@
package org.jvnet.tiger_types;
-import junit.framework.TestCase;
-
import java.net.Proxy.Type;
import java.util.EnumSet;
import java.util.Set;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.junit.jupiter.api.Assertions.assertAll;
+
/**
* @author Kohsuke Kawaguchi
*/
-public class ListerTest extends TestCase {
+public class ListerTest {
+ // is used in the test method
public EnumSet<Type> set;
+ @Test
public void testEnumSet() throws Exception {
- Lister l = Lister.create(getClass().getDeclaredField("set").getGenericType());
- l.add(Type.HTTP);
- l.add(Type.SOCKS);
- Set col = (Set)l.toCollection();
- assertTrue(col instanceof EnumSet);
- assertTrue(col.contains(Type.HTTP));
+ final Lister<?> lister = Lister.create(getClass().getDeclaredField("set").getGenericType());
+ lister.add(Type.HTTP);
+ lister.add(Type.SOCKS);
+ final Set<?> col = (Set<?>) lister.toCollection();
+ assertAll(
+ () -> assertThat(col, instanceOf(EnumSet.class)),
+ () -> assertThat(col, containsInAnyOrder(Type.HTTP, Type.SOCKS))
+ );
}
}