Skip to content

File tree

1 file changed

+5
-6
lines changed
  • src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/github

1 file changed

+5
-6
lines changed

src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/github/Github27.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ import com.fasterxml.jackson.databind.SerializationFeature
66
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
77
import com.fasterxml.jackson.module.kotlin.readValue
88
import com.fasterxml.jackson.module.kotlin.test.expectFailure
9-
import org.hamcrest.CoreMatchers.equalTo
10-
import org.hamcrest.MatcherAssert.assertThat
9+
import org.junit.jupiter.api.Assertions
10+
import org.junit.jupiter.api.Assertions.assertEquals
1111
import org.junit.jupiter.api.Test
1212
import kotlin.test.assertTrue
1313
import kotlin.test.fail
1414

15-
1615
class TestGithub27 {
1716
val mapper: ObjectMapper = jacksonObjectMapper().configure(SerializationFeature.INDENT_OUTPUT, false)
1817

@@ -21,23 +20,23 @@ class TestGithub27 {
2120
@Test fun testNullableInt() {
2221
val json = """{"sample":null}"""
2322
val stateObj = mapper.readValue<ClassWithNullableInt>(json)
24-
assertThat(stateObj, equalTo(ClassWithNullableInt(null)))
23+
assertEquals(ClassWithNullableInt(null), stateObj)
2524
}
2625

2726
private data class ClassWithInt(val sample: Int)
2827

2928
@Test fun testInt() {
3029
val json = """{"sample":null}"""
3130
val stateObj = mapper.readValue<ClassWithInt>(json)
32-
assertThat(stateObj, equalTo(ClassWithInt(0)))
31+
assertEquals(ClassWithInt(0), stateObj)
3332
}
3433

3534
private data class ClassWithListOfNullableInt(val samples: List<Int?>)
3635

3736
@Test fun testListOfNullableInt() {
3837
val json = """{"samples":[1, null]}"""
3938
val stateObj = mapper.readValue<ClassWithListOfInt>(json)
40-
assertThat(stateObj.samples, equalTo(listOf(1, null)))
39+
assertEquals(listOf(1, null), stateObj.samples)
4140
}
4241

4342
private data class ClassWithListOfInt(val samples: List<Int>)

0 commit comments

Comments
 (0)