diff --git a/build.gradle b/build.gradle index 155ffcc..16d7ada 100644 --- a/build.gradle +++ b/build.gradle @@ -42,7 +42,11 @@ dependencies { testImplementation "org.embulk:embulk-spi:0.11" testImplementation "org.msgpack:msgpack-core:0.8.24" - testImplementation "junit:junit:4.13.2" + + testImplementation "org.junit.jupiter:junit-jupiter-api:5.9.3" + testImplementation "org.junit.jupiter:junit-jupiter-params:5.9.3" + + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.9.3" } javadoc { @@ -173,6 +177,7 @@ signing { } test { + useJUnitPlatform() testLogging { events "passed", "skipped", "failed", "standardOut", "standardError" exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL diff --git a/src/test/java/org/embulk/util/json/TestJsonParser.java b/src/test/java/org/embulk/util/json/TestJsonParser.java index 8a9e7ec..19fcd4a 100644 --- a/src/test/java/org/embulk/util/json/TestJsonParser.java +++ b/src/test/java/org/embulk/util/json/TestJsonParser.java @@ -16,10 +16,11 @@ package org.embulk.util.json; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.ByteArrayInputStream; import java.io.InputStream; @@ -27,7 +28,7 @@ import java.util.Arrays; import java.util.Map; import java.util.stream.Collectors; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.msgpack.value.Value; import org.msgpack.value.ValueFactory; @@ -41,10 +42,11 @@ public void testString() throws Exception { assertEquals("foobar", msgpackValue.asStringValue().toString()); } - @Test(expected = JsonParseException.class) public void testStringUnquoted() throws Exception { final JsonParser parser = new JsonParser(); - parser.parse("foobar"); + assertThrows(JsonParseException.class, () -> { + parser.parse("foobar"); + }); } @Test