@@ -5,8 +5,8 @@ import com.fasterxml.jackson.module.kotlin.KotlinFeature.StrictNullChecks
55import com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException
66import com.fasterxml.jackson.module.kotlin.kotlinModule
77import com.fasterxml.jackson.module.kotlin.readValue
8- import org.hamcrest.CoreMatchers.equalTo
9- import org.hamcrest.MatcherAssert.assertThat
8+ import org.junit.jupiter.api.Assertions.assertArrayEquals
9+ import org.junit.jupiter.api.Assertions.assertEquals
1010import org.junit.jupiter.api.Disabled
1111import org.junit.jupiter.api.Test
1212import org.junit.jupiter.api.assertThrows
@@ -23,7 +23,7 @@ class StrictNullChecksTest {
2323 fun testListOfNullableInt () {
2424 val json = """ {"samples":[1, null]}"""
2525 val stateObj = mapper.readValue<ClassWithListOfNullableInt >(json)
26- assertThat(stateObj.samples, equalTo( listOf (1 , null )) )
26+ assertEquals( listOf (1 , null ), stateObj.samples )
2727 }
2828
2929 private data class ClassWithListOfInt (val samples : List <Int >)
@@ -53,7 +53,7 @@ class StrictNullChecksTest {
5353 fun testArrayOfNullableInt () {
5454 val json = """ {"samples":[1, null]}"""
5555 val stateObj = mapper.readValue<ClassWithArrayOfNullableInt >(json)
56- assertThat(stateObj.samples, equalTo( arrayOf(1 , null )) )
56+ assertArrayEquals( arrayOf(1 , null ), stateObj.samples )
5757 }
5858
5959 private data class ClassWithArrayOfInt (val samples : Array <Int >)
@@ -83,7 +83,7 @@ class StrictNullChecksTest {
8383 fun testMapOfStringToNullableInt () {
8484 val json = """ { "samples": { "key": null } }"""
8585 val stateObj = mapper.readValue<ClassWithMapOfStringToNullableInt >(json)
86- assertThat(stateObj.samples, equalTo( mapOf<String , Int ?>(" key" to null )) )
86+ assertEquals( mapOf<String , Int ?>(" key" to null ), stateObj.samples )
8787 }
8888
8989 private data class ClassWithMapOfStringToInt (val samples : Map <String , Int >)
@@ -113,7 +113,7 @@ class StrictNullChecksTest {
113113 fun testListOfGeneric () {
114114 val json = """ {"samples":[1, 2]}"""
115115 val stateObj = mapper.readValue<TestClass <List <Int >>>(json)
116- assertThat(stateObj.samples, equalTo( listOf (1 , 2 )) )
116+ assertEquals( listOf (1 , 2 ), stateObj.samples )
117117 }
118118
119119 @Disabled // this is a hard problem to solve and is currently not addressed
@@ -129,7 +129,7 @@ class StrictNullChecksTest {
129129 fun testMapOfGeneric () {
130130 val json = """ { "samples": { "key": 1 } }"""
131131 val stateObj = mapper.readValue<TestClass <Map <String , Int >>>(json)
132- assertThat(stateObj.samples, equalTo( mapOf (" key" to 1 )) )
132+ assertEquals( mapOf (" key" to 1 ), stateObj.samples )
133133 }
134134
135135 @Disabled // this is a hard problem to solve and is currently not addressed
@@ -145,7 +145,7 @@ class StrictNullChecksTest {
145145 fun testArrayOfGeneric () {
146146 val json = """ {"samples":[1, 2]}"""
147147 val stateObj = mapper.readValue<TestClass <Array <Int >>>(json)
148- assertThat(stateObj.samples, equalTo( arrayOf(1 , 2 )) )
148+ assertArrayEquals( arrayOf(1 , 2 ), stateObj.samples )
149149 }
150150
151151 @Disabled // this is a hard problem to solve and is currently not addressed
0 commit comments