1
1
package com.fasterxml.jackson.module.kotlin.test
2
2
3
3
import com.fasterxml.jackson.databind.ObjectMapper
4
+ import com.fasterxml.jackson.databind.exc.MismatchedInputException
4
5
import com.fasterxml.jackson.module.kotlin.KotlinFeature.StrictNullChecks
5
- import com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException
6
6
import com.fasterxml.jackson.module.kotlin.kotlinModule
7
7
import com.fasterxml.jackson.module.kotlin.readValue
8
8
import org.hamcrest.CoreMatchers.equalTo
@@ -27,7 +27,7 @@ class StrictNullChecksTest {
27
27
28
28
private data class ClassWithListOfInt (val samples : List <Int >)
29
29
30
- @Test(expected = MissingKotlinParameterException ::class )
30
+ @Test(expected = MismatchedInputException ::class )
31
31
fun testListOfInt () {
32
32
val json = """ {"samples":[1, null]}"""
33
33
mapper.readValue<ClassWithListOfInt >(json)
@@ -55,7 +55,7 @@ class StrictNullChecksTest {
55
55
56
56
private data class ClassWithArrayOfInt (val samples : Array <Int >)
57
57
58
- @Test(expected = MissingKotlinParameterException ::class )
58
+ @Test(expected = MismatchedInputException ::class )
59
59
fun testArrayOfInt () {
60
60
val json = """ {"samples":[1, null]}"""
61
61
mapper.readValue<ClassWithArrayOfInt >(json)
@@ -83,7 +83,7 @@ class StrictNullChecksTest {
83
83
84
84
private data class ClassWithMapOfStringToInt (val samples : Map <String , Int >)
85
85
86
- @Test(expected = MissingKotlinParameterException ::class )
86
+ @Test(expected = MismatchedInputException ::class )
87
87
fun testMapOfStringToIntWithNullValue () {
88
88
val json = """ { "samples": { "key": null } }"""
89
89
mapper.readValue<ClassWithMapOfStringToInt >(json)
@@ -110,7 +110,7 @@ class StrictNullChecksTest {
110
110
}
111
111
112
112
@Ignore // this is a hard problem to solve and is currently not addressed
113
- @Test(expected = MissingKotlinParameterException ::class )
113
+ @Test(expected = MismatchedInputException ::class )
114
114
fun testListOfGenericWithNullValue () {
115
115
val json = """ {"samples":[1, null]}"""
116
116
mapper.readValue<TestClass <List <Int >>>(json)
@@ -124,7 +124,7 @@ class StrictNullChecksTest {
124
124
}
125
125
126
126
@Ignore // this is a hard problem to solve and is currently not addressed
127
- @Test(expected = MissingKotlinParameterException ::class )
127
+ @Test(expected = MismatchedInputException ::class )
128
128
fun testMapOfGenericWithNullValue () {
129
129
val json = """ { "samples": { "key": null } }"""
130
130
mapper.readValue<TestClass <Map <String , Int >>>(json)
@@ -138,7 +138,7 @@ class StrictNullChecksTest {
138
138
}
139
139
140
140
@Ignore // this is a hard problem to solve and is currently not addressed
141
- @Test(expected = MissingKotlinParameterException ::class )
141
+ @Test(expected = MismatchedInputException ::class )
142
142
fun testArrayOfGenericWithNullValue () {
143
143
val json = """ {"samples":[1, null]}"""
144
144
mapper.readValue<TestClass <Array <Int >>>(json)
0 commit comments