Skip to content

File tree

1 file changed

+14
-24
lines changed
  • src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/github

1 file changed

+14
-24
lines changed

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

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import com.fasterxml.jackson.databind.JsonNode
44
import com.fasterxml.jackson.databind.node.NullNode
55
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
66
import com.fasterxml.jackson.module.kotlin.readValue
7-
import org.hamcrest.CoreMatchers
8-
import org.hamcrest.MatcherAssert.assertThat
7+
import org.junit.jupiter.api.Assertions.assertEquals
8+
import org.junit.jupiter.api.Assertions.assertNull
99
import org.junit.jupiter.api.Test
1010

1111
class TestGithub490 {
@@ -18,55 +18,45 @@ class TestGithub490 {
1818

1919
@Test
2020
fun testKotlinDeserialization_intValue() {
21-
assertThat(
22-
"Nullable missing Int value should be deserialized as null",
23-
value.intValue,
24-
CoreMatchers.nullValue()
25-
)
21+
assertNull(value.intValue, "Nullable missing Int value should be deserialized as null")
2622
}
2723

2824
@Test
2925
fun testKotlinDeserialization_stringValue() {
30-
assertThat(
31-
"Nullable missing String value should be deserialized as null",
32-
value.stringValue,
33-
CoreMatchers.nullValue()
34-
)
26+
assertNull(value.stringValue, "Nullable missing String value should be deserialized as null")
3527
}
3628

3729
@Test
3830
fun testKotlinDeserialization_jsonNodeValue() {
39-
assertThat(
40-
"Nullable missing JsonNode value should be deserialized as null and not as NullNode",
31+
assertNull(
4132
value.jsonNodeValue,
42-
CoreMatchers.nullValue()
33+
"Nullable missing JsonNode value should be deserialized as null and not as NullNode"
4334
)
4435
}
4536

4637
@Test
4738
fun testKotlinDeserialization_jsonNodeValueProvidedNull() {
48-
assertThat(
49-
"Nullable JsonNode value provided as null should be deserialized as NullNode",
39+
assertEquals(
40+
NullNode.instance,
5041
value.jsonNodeValueProvidedNull,
51-
CoreMatchers.equalTo(NullNode.instance)
42+
"Nullable JsonNode value provided as null should be deserialized as NullNode"
5243
)
5344
}
5445

5546
@Test
5647
fun testKotlinDeserialization_jsonNodeValueWithNullAsDefault() {
57-
assertThat(
58-
"Nullable by default missing JsonNode value should be deserialized as null and not as NullNode",
48+
assertNull(
5949
value.jsonNodeValueWithNullAsDefault,
60-
CoreMatchers.nullValue()
50+
"Nullable by default missing JsonNode value should be deserialized as null and not as NullNode"
6151
)
6252
}
6353

6454
@Test
6555
fun testKotlinDeserialization_jsonNodeValueWithNullAsDefaultProvidedNull() {
66-
assertThat(
67-
"Nullable by default JsonNode with provided null value in payload should be deserialized as NullNode",
56+
assertEquals(
57+
NullNode.instance,
6858
value.jsonNodeValueWithNullAsDefaultProvidedNull,
69-
CoreMatchers.equalTo(NullNode.instance)
59+
"Nullable by default JsonNode with provided null value in payload should be deserialized as NullNode"
7060
)
7161
}
7262
}

0 commit comments

Comments
 (0)