Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate JUnit 4 to 5 #39

Merged
merged 2 commits into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
implementation("org.assertj:assertj-core:3.26.3")
implementation("org.jetbrains:annotations:24.1.0")
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:2.0.0")
testImplementation("junit:junit:4.13.2")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.3")
testImplementation("org.assertj:assertj-core:3.26.3")
}

Expand All @@ -38,6 +38,10 @@ tasks.withType<KotlinCompile> {
}
}

tasks.test {
useJUnitPlatform()
}

publishing {
publications {
register<MavenPublication>("maven") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.orangain.jsonmatch

import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class ArrayLiteralTest {

Expand Down
8 changes: 2 additions & 6 deletions src/test/kotlin/io/github/orangain/jsonmatch/AssertionTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch;

import org.assertj.core.api.Assertions.assertThatCode
import org.assertj.core.api.Assertions.assertThatThrownBy
import org.junit.Test
import org.junit.jupiter.api.Test


class AssertionTest {
Expand Down Expand Up @@ -43,11 +43,7 @@ class AssertionTest {
JsonStringAssert.assertThat("""{"foo": "bar"}""").jsonMatches("""{ "foo": "#null" }""")
}.isInstanceOf(AssertionError::class.java).hasMessage(
"""
path: $.foo, actual: "bar", expected: "#null", reason: not-null expected:<"{
"foo" : "[#null]"
}"> but was:<"{
"foo" : "[bar]"
}">
path: $.foo, actual: "bar", expected: "#null", reason: not-null
""".trimIndent()
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.orangain.jsonmatch

import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class BasicValidatorTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.orangain.jsonmatch

import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class EmptyObjectLiteralTest {
val patternJson = "{}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.orangain.jsonmatch

import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class ObjectLiteralTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.orangain.jsonmatch

import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class TypeValidatorTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class ArrayBracketMarkerTest {
private val patternJson = """{ "a": "#[]" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class ArrayBracketMarkerWithChildrenTest {
private val patternJson = """{ "a": "#[] #number" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class ArrayBracketMarkerWithNestedChildrenTest {
private val patternJson = """{ "a": "#[] #[] #number" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class ArrayBracketSizeMarkerTest {
private val patternJson = """{ "a": "#[3]" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class ArrayMarkerTest {
private val patternJson = """{ "a": "#array" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class BooleanMarkerTest {
private val patternJson = """{ "a": "#boolean" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class DateMarkerTest {
private val patternJson = """{ "a": "#date" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class DateTimeMarkerTest {
private val patternJson = """{ "a": "#datetime" }"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.junit.Test
import org.junit.jupiter.api.Test

class IgnoreMarkerTest {
private val patternJson = """{ "a": "#ignore" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class NotNullMarkerTest {
private val patternJson = """{ "a": "#notnull" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class NotPresentMarkerTest {
private val patternJson = """{ "a": "#notpresent" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class NullMarkerTest {
private val patternJson = """{ "a": "#null" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class NumberMarkerTest {
private val patternJson = """{ "a": "#number" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class ObjectMarkerTest {
private val patternJson = """{ "a": "#object" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class PresentMarkerTest {
private val patternJson = """{ "a": "#present" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class RegexMarkerTest {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class StringMarkerTest {
private val patternJson = """{ "a": "#string" }"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test
import java.util.*

class UUIDMarkerTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.orangain.jsonmatch.marker

import io.github.orangain.jsonmatch.JsonStringAssert
import org.assertj.core.api.Assertions
import org.junit.Test
import org.junit.jupiter.api.Test

class UnknownMarkerTest {
private val patternJson = """{ "a": "#unknown" }"""
Expand Down