Skip to content

Commit 572fcbb

Browse files
authored
Merge pull request #39 from orangain/junit5
Migrate JUnit 4 to 5
2 parents 488f286 + 2b1fa9c commit 572fcbb

26 files changed

+31
-31
lines changed

build.gradle.kts

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies {
2121
implementation("org.assertj:assertj-core:3.26.3")
2222
implementation("org.jetbrains:annotations:24.1.0")
2323
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:2.0.0")
24-
testImplementation("junit:junit:4.13.2")
24+
testImplementation("org.junit.jupiter:junit-jupiter:5.10.3")
2525
testImplementation("org.assertj:assertj-core:3.26.3")
2626
}
2727

@@ -38,6 +38,10 @@ tasks.withType<KotlinCompile> {
3838
}
3939
}
4040

41+
tasks.test {
42+
useJUnitPlatform()
43+
}
44+
4145
publishing {
4246
publications {
4347
register<MavenPublication>("maven") {

src/test/kotlin/io/github/orangain/jsonmatch/ArrayLiteralTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.github.orangain.jsonmatch
22

33
import org.assertj.core.api.Assertions
4-
import org.junit.Test
4+
import org.junit.jupiter.api.Test
55

66
class ArrayLiteralTest {
77

src/test/kotlin/io/github/orangain/jsonmatch/AssertionTest.kt

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch;
22

33
import org.assertj.core.api.Assertions.assertThatCode
44
import org.assertj.core.api.Assertions.assertThatThrownBy
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77

88
class AssertionTest {
@@ -43,11 +43,7 @@ class AssertionTest {
4343
JsonStringAssert.assertThat("""{"foo": "bar"}""").jsonMatches("""{ "foo": "#null" }""")
4444
}.isInstanceOf(AssertionError::class.java).hasMessage(
4545
"""
46-
path: $.foo, actual: "bar", expected: "#null", reason: not-null expected:<"{
47-
"foo" : "[#null]"
48-
}"> but was:<"{
49-
"foo" : "[bar]"
50-
}">
46+
path: $.foo, actual: "bar", expected: "#null", reason: not-null
5147
""".trimIndent()
5248
)
5349
}

src/test/kotlin/io/github/orangain/jsonmatch/BasicValidatorTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.github.orangain.jsonmatch
22

33
import org.assertj.core.api.Assertions
4-
import org.junit.Test
4+
import org.junit.jupiter.api.Test
55

66
class BasicValidatorTest {
77

src/test/kotlin/io/github/orangain/jsonmatch/EmptyObjectLiteralTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.github.orangain.jsonmatch
22

33
import org.assertj.core.api.Assertions
4-
import org.junit.Test
4+
import org.junit.jupiter.api.Test
55

66
class EmptyObjectLiteralTest {
77
val patternJson = "{}"

src/test/kotlin/io/github/orangain/jsonmatch/ObjectLiteralTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.github.orangain.jsonmatch
22

33
import org.assertj.core.api.Assertions
4-
import org.junit.Test
4+
import org.junit.jupiter.api.Test
55

66
class ObjectLiteralTest {
77

src/test/kotlin/io/github/orangain/jsonmatch/TypeValidatorTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.github.orangain.jsonmatch
22

33
import org.assertj.core.api.Assertions
4-
import org.junit.Test
4+
import org.junit.jupiter.api.Test
55

66
class TypeValidatorTest {
77

src/test/kotlin/io/github/orangain/jsonmatch/marker/ArrayBracketMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class ArrayBracketMarkerTest {
88
private val patternJson = """{ "a": "#[]" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/ArrayBracketMarkerWithChildrenTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class ArrayBracketMarkerWithChildrenTest {
88
private val patternJson = """{ "a": "#[] #number" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/ArrayBracketMarkerWithNestedChildrenTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class ArrayBracketMarkerWithNestedChildrenTest {
88
private val patternJson = """{ "a": "#[] #[] #number" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/ArrayBracketSizeMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class ArrayBracketSizeMarkerTest {
88
private val patternJson = """{ "a": "#[3]" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/ArrayMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class ArrayMarkerTest {
88
private val patternJson = """{ "a": "#array" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/BooleanMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class BooleanMarkerTest {
88
private val patternJson = """{ "a": "#boolean" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/DateMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class DateMarkerTest {
88
private val patternJson = """{ "a": "#date" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/DateTimeMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class DateTimeMarkerTest {
88
private val patternJson = """{ "a": "#datetime" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/IgnoreMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
4-
import org.junit.Test
4+
import org.junit.jupiter.api.Test
55

66
class IgnoreMarkerTest {
77
private val patternJson = """{ "a": "#ignore" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/NotNullMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class NotNullMarkerTest {
88
private val patternJson = """{ "a": "#notnull" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/NotPresentMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class NotPresentMarkerTest {
88
private val patternJson = """{ "a": "#notpresent" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/NullMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class NullMarkerTest {
88
private val patternJson = """{ "a": "#null" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/NumberMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class NumberMarkerTest {
88
private val patternJson = """{ "a": "#number" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/ObjectMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class ObjectMarkerTest {
88
private val patternJson = """{ "a": "#object" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/PresentMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class PresentMarkerTest {
88
private val patternJson = """{ "a": "#present" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/RegexMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class RegexMarkerTest {
88
@Test

src/test/kotlin/io/github/orangain/jsonmatch/marker/StringMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class StringMarkerTest {
88
private val patternJson = """{ "a": "#string" }"""

src/test/kotlin/io/github/orangain/jsonmatch/marker/UUIDMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66
import java.util.*
77

88
class UUIDMarkerTest {

src/test/kotlin/io/github/orangain/jsonmatch/marker/UnknownMarkerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker
22

33
import io.github.orangain.jsonmatch.JsonStringAssert
44
import org.assertj.core.api.Assertions
5-
import org.junit.Test
5+
import org.junit.jupiter.api.Test
66

77
class UnknownMarkerTest {
88
private val patternJson = """{ "a": "#unknown" }"""

0 commit comments

Comments
 (0)