File tree 2 files changed +25
-0
lines changed
src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/github/failing
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ kkurczewski
21
21
* #689 : Add KotlinDuration support
22
22
23
23
WrongWrong (@k163377 )
24
+ * #709 : Add failing test for #242
24
25
* #707 : Changed to use default argument on null if JsonSetter(nulls = Nulls.SKIP) is specified.
25
26
* #700 : Reduce the load on the search process for serializers
26
27
* #687 : Optimize and Refactor KotlinValueInstantiator.createFromObjectWith
Original file line number Diff line number Diff line change
1
+ package com.fasterxml.jackson.module.kotlin.test.github.failing
2
+
3
+ import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
4
+ import com.fasterxml.jackson.module.kotlin.readValue
5
+ import org.junit.Test
6
+ import kotlin.test.assertEquals
7
+
8
+ // Also see https://github.com/FasterXML/jackson-databind/issues/3392
9
+ class Github242 {
10
+ data class IntValue (val value : Int )
11
+
12
+ private val objectMapper = jacksonObjectMapper()
13
+
14
+ // Since `nullish` is entered for a `non-null` value, deserialization is expected to fail,
15
+ // but at the moment the process continues with the default value set on the `databind`.
16
+ @Test
17
+ fun `test value throws - Int` (){
18
+ val v0 = objectMapper.readValue<IntValue >(" {}" )
19
+ val v1 = objectMapper.readValue<IntValue >(" {\" value\" :null}" )
20
+
21
+ assertEquals(0 , v0.value)
22
+ assertEquals(v0, v1)
23
+ }
24
+ }
You can’t perform that action at this time.
0 commit comments