Skip to content

Commit 4ab4308

Browse files
committed
Fix to test that KotlinInvalidNullException is thrown
1 parent e2e6b48 commit 4ab4308

File tree

1 file changed

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

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.fasterxml.jackson.module.kotlin.test.github
22

33
import com.fasterxml.jackson.databind.JsonMappingException
4-
import com.fasterxml.jackson.databind.exc.MismatchedInputException
4+
import com.fasterxml.jackson.module.kotlin.KotlinInvalidNullException
55
import com.fasterxml.jackson.module.kotlin.defaultMapper
66
import com.fasterxml.jackson.module.kotlin.readValue
77
import org.junit.jupiter.api.Assertions.assertEquals
@@ -19,8 +19,8 @@ private class TestGithub32 {
1919
}
2020

2121
@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"
2424
) {
2525
defaultMapper.readValue<Person>("""
2626
{
@@ -35,7 +35,7 @@ private class TestGithub32 {
3535
}
3636

3737
@Test fun `null mandatory data class constructor param`() {
38-
val thrown = assertThrows<MismatchedInputException> {
38+
val thrown = assertThrows<KotlinInvalidNullException> {
3939
defaultMapper.readValue<Person>("""
4040
{
4141
"firstName": null,
@@ -50,7 +50,7 @@ private class TestGithub32 {
5050
}
5151

5252
@Test fun `missing mandatory constructor param - nested in class with default constructor`() {
53-
val thrown = assertThrows<MismatchedInputException> {
53+
val thrown = assertThrows<KotlinInvalidNullException> {
5454
defaultMapper.readValue<WrapperWithDefaultContructor>("""
5555
{
5656
"person": {
@@ -66,7 +66,7 @@ private class TestGithub32 {
6666
}
6767

6868
@Test fun `missing mandatory constructor param - nested in class with single arg constructor`() {
69-
val thrown = assertThrows<MismatchedInputException> {
69+
val thrown = assertThrows<KotlinInvalidNullException> {
7070
defaultMapper.readValue<WrapperWithArgsContructor>("""
7171
{
7272
"person": {
@@ -82,7 +82,7 @@ private class TestGithub32 {
8282
}
8383

8484
@Test fun `missing mandatory constructor param - nested in class with List arg constructor`() {
85-
val thrown = assertThrows<MismatchedInputException> {
85+
val thrown = assertThrows<KotlinInvalidNullException> {
8686
defaultMapper.readValue<Crowd>("""
8787
{
8888
"people": [

0 commit comments

Comments
 (0)