1
1
package com.fasterxml.jackson.module.kotlin.test.github
2
2
3
3
import com.fasterxml.jackson.databind.JsonMappingException
4
- import com.fasterxml.jackson.databind.exc.MismatchedInputException
4
+ import com.fasterxml.jackson.module.kotlin.KotlinInvalidNullException
5
5
import com.fasterxml.jackson.module.kotlin.defaultMapper
6
6
import com.fasterxml.jackson.module.kotlin.readValue
7
7
import org.junit.jupiter.api.Assertions.assertEquals
@@ -19,8 +19,8 @@ private class TestGithub32 {
19
19
}
20
20
21
21
@Test fun `missing mandatory data class constructor param` () {
22
- val thrown = assertThrows<MismatchedInputException >(
23
- " MissingKotlinParameterException with missing `firstName` parameter"
22
+ val thrown = assertThrows<KotlinInvalidNullException >(
23
+ " KotlinInvalidNullException with missing `firstName` parameter"
24
24
) {
25
25
defaultMapper.readValue<Person >("""
26
26
{
@@ -35,7 +35,7 @@ private class TestGithub32 {
35
35
}
36
36
37
37
@Test fun `null mandatory data class constructor param` () {
38
- val thrown = assertThrows<MismatchedInputException > {
38
+ val thrown = assertThrows<KotlinInvalidNullException > {
39
39
defaultMapper.readValue<Person >("""
40
40
{
41
41
"firstName": null,
@@ -50,7 +50,7 @@ private class TestGithub32 {
50
50
}
51
51
52
52
@Test fun `missing mandatory constructor param - nested in class with default constructor` () {
53
- val thrown = assertThrows<MismatchedInputException > {
53
+ val thrown = assertThrows<KotlinInvalidNullException > {
54
54
defaultMapper.readValue<WrapperWithDefaultContructor >("""
55
55
{
56
56
"person": {
@@ -66,7 +66,7 @@ private class TestGithub32 {
66
66
}
67
67
68
68
@Test fun `missing mandatory constructor param - nested in class with single arg constructor` () {
69
- val thrown = assertThrows<MismatchedInputException > {
69
+ val thrown = assertThrows<KotlinInvalidNullException > {
70
70
defaultMapper.readValue<WrapperWithArgsContructor >("""
71
71
{
72
72
"person": {
@@ -82,7 +82,7 @@ private class TestGithub32 {
82
82
}
83
83
84
84
@Test fun `missing mandatory constructor param - nested in class with List arg constructor` () {
85
- val thrown = assertThrows<MismatchedInputException > {
85
+ val thrown = assertThrows<KotlinInvalidNullException > {
86
86
defaultMapper.readValue<Crowd >("""
87
87
{
88
88
"people": [
0 commit comments