Skip to content

Commit 27b9977

Browse files
committed
Merge remote-tracking branch 'FasterXML/2.19'
2 parents bed5828 + 2ee6fe9 commit 27b9977

File tree

142 files changed

+760
-828
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+760
-828
lines changed

pom.xml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,26 @@
111111

112112
<!-- only for testing... -->
113113
<dependency>
114-
<groupId>junit</groupId>
115-
<artifactId>junit</artifactId>
114+
<groupId>org.junit.jupiter</groupId>
115+
<artifactId>junit-jupiter</artifactId>
116+
<scope>test</scope>
117+
</dependency>
118+
<dependency>
119+
<groupId>org.junit.jupiter</groupId>
120+
<artifactId>junit-jupiter-api</artifactId>
116121
<scope>test</scope>
117122
</dependency>
118123
<dependency>
119124
<groupId>org.jetbrains.kotlin</groupId>
120125
<artifactId>kotlin-test-junit</artifactId>
121126
<version>${version.kotlin}</version>
122127
<scope>test</scope>
128+
<exclusions>
129+
<exclusion>
130+
<groupId>junit</groupId>
131+
<artifactId>junit</artifactId>
132+
</exclusion>
133+
</exclusions>
123134
</dependency>
124135
<dependency>
125136
<groupId>tools.jackson.dataformat</groupId>

release-notes/CREDITS-2.x

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Contributors:
1818
# 2.19.0 (not yet released)
1919

2020
WrongWrong (@k163377)
21+
* #866: Upgrade to JUnit5
2122
* #861: Update Kotlin to 1.9.24
2223
* #858: Refactor findDefaultCreator
2324
* #839: Remove useKotlinPropertyNameForGetter and unify with kotlinPropertyNameAsImplicitName

src/test/kotlin/tools/jackson/module/kotlin/ArgumentBucketTest.kt

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
package tools.jackson.module.kotlin
22

33
import com.fasterxml.jackson.annotation.JsonCreator
4-
import org.junit.Ignore
5-
import org.junit.experimental.runners.Enclosed
6-
import org.junit.runner.RunWith
4+
import org.junit.jupiter.api.Nested
75
import kotlin.reflect.KFunction
86
import kotlin.reflect.full.functions
97
import kotlin.reflect.full.hasAnnotation
10-
import kotlin.test.Test
8+
import org.junit.jupiter.api.Test
119
import kotlin.test.assertEquals
1210
import kotlin.test.assertFalse
1311
import kotlin.test.assertTrue
1412

15-
16-
@RunWith(Enclosed::class)
1713
class ArgumentBucketTest {
18-
class Normal {
19-
@Ignore
20-
data class Constructor(val foo: String, val bar: String)
14+
data class Constructor(val foo: String, val bar: String)
15+
16+
data class Method(val foo: String, val bar: String) {
17+
companion object {
18+
@JvmStatic
19+
@JsonCreator
20+
fun of(foo: String, bar: String): Method = Method(foo, bar)
21+
}
22+
}
2123

24+
@Nested
25+
inner class Normal {
2226
@Test
2327
fun constructorTest() {
24-
val function: KFunction<*> = Normal::Constructor
28+
val function: KFunction<*> = ::Constructor
2529
val params = function.parameters
2630
val generator = BucketGenerator.forConstructor(params.size)
2731
val bucket = generator.generate()
@@ -45,15 +49,6 @@ class ArgumentBucketTest {
4549
assertEquals("bar", bucket[params[1]])
4650
}
4751

48-
@Ignore
49-
data class Method(val foo: String, val bar: String) {
50-
companion object {
51-
@JvmStatic
52-
@JsonCreator
53-
fun of(foo: String, bar: String): Method = Method(foo, bar)
54-
}
55-
}
56-
5752
@Test
5853
fun methodTest() {
5954
val function: KFunction<*> = Method.Companion::class.functions.first { it.hasAnnotation<JsonCreator>() }

src/test/kotlin/tools/jackson/module/kotlin/DslTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import tools.jackson.module.kotlin.KotlinFeature.NullToEmptyCollection
77
import tools.jackson.module.kotlin.KotlinFeature.NullToEmptyMap
88
import tools.jackson.module.kotlin.KotlinFeature.SingletonSupport
99
import tools.jackson.module.kotlin.KotlinFeature.StrictNullChecks
10-
import org.junit.Assert.assertNotNull
11-
import org.junit.Test
10+
import org.junit.jupiter.api.Assertions.assertNotNull
11+
import org.junit.jupiter.api.Test
1212
import kotlin.test.assertEquals
1313
import kotlin.test.assertFalse
1414
import kotlin.test.assertTrue

src/test/kotlin/tools/jackson/module/kotlin/JDKSerializabilityTestHelper.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package tools.jackson.module.kotlin
22

3-
import junit.framework.TestCase
3+
import org.junit.jupiter.api.Assertions.fail
44
import java.io.ByteArrayInputStream
55
import java.io.ByteArrayOutputStream
66
import java.io.ObjectInputStream
@@ -14,14 +14,13 @@ fun jdkSerialize(o: Any): ByteArray {
1414
return bytes.toByteArray()
1515
}
1616

17-
fun <T> jdkDeserialize(raw: ByteArray): T? {
17+
fun <T> jdkDeserialize(raw: ByteArray): T {
1818
val objIn = ObjectInputStream(ByteArrayInputStream(raw))
1919
return try {
2020
@Suppress("UNCHECKED_CAST")
2121
objIn.readObject() as T
2222
} catch (e: ClassNotFoundException) {
23-
TestCase.fail("Missing class: " + e.message)
24-
null
23+
fail("Missing class: " + e.message)
2524
} finally {
2625
objIn.close()
2726
}

src/test/kotlin/tools/jackson/module/kotlin/KotlinInstantiatorsTest.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package tools.jackson.module.kotlin
22

33
import tools.jackson.databind.deser.std.StdValueInstantiator
4-
import org.junit.Assert.assertEquals
5-
import org.junit.Assert.assertThrows
6-
import org.junit.Assert.assertTrue
7-
import org.junit.Test
4+
import org.junit.jupiter.api.Assertions.*
5+
import org.junit.jupiter.api.Test
86

97
class KotlinInstantiatorsTest {
108
private val mapper = jacksonObjectMapper()

src/test/kotlin/tools/jackson/module/kotlin/KotlinModuleTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package tools.jackson.module.kotlin
22

33
import tools.jackson.module.kotlin.KotlinFeature.*
4-
import org.junit.Assert.assertEquals
5-
import org.junit.Assert.assertFalse
6-
import org.junit.Assert.assertTrue
7-
import org.junit.Test
84
import tools.jackson.databind.json.JsonMapper
5+
import org.junit.jupiter.api.Assertions.assertEquals
6+
import org.junit.jupiter.api.Assertions.assertFalse
7+
import org.junit.jupiter.api.Assertions.assertTrue
8+
import org.junit.jupiter.api.Test
99
import kotlin.test.assertNotNull
1010

1111
class KotlinModuleTest {

src/test/kotlin/tools/jackson/module/kotlin/MissingKotlinParameterExceptionTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package tools.jackson.module.kotlin
22

3-
import org.junit.Test
3+
import org.junit.jupiter.api.Test
44
import kotlin.test.assertNotNull
55
import kotlin.test.assertNull
66

src/test/kotlin/tools/jackson/module/kotlin/ReflectionCacheTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package tools.jackson.module.kotlin
22

3-
import org.junit.Test
3+
import org.junit.jupiter.api.Test
44
import kotlin.test.assertNotNull
55

66
class ReflectionCacheTest {

src/test/kotlin/tools/jackson/module/kotlin/kogeraIntegration/deser/valueClass/JacksonInjectTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package tools.jackson.module.kotlin.kogeraIntegration.deser.valueClass
22

33
import com.fasterxml.jackson.annotation.JacksonInject
4-
import org.junit.Assert.assertEquals
5-
import org.junit.Assert.assertThrows
6-
import org.junit.Test
74
import tools.jackson.databind.InjectableValues
85
import tools.jackson.databind.MapperFeature
96
import tools.jackson.module.kotlin.jacksonMapperBuilder
107
import tools.jackson.module.kotlin.jacksonObjectMapper
8+
import org.junit.jupiter.api.Assertions.assertEquals
9+
import org.junit.jupiter.api.Assertions.assertThrows
10+
import org.junit.jupiter.api.Test
1111

1212
class JacksonInjectTest {
1313
// This is specified as a getter because there is a possibility of problems if it is assigned to a field.

0 commit comments

Comments
 (0)