File tree 1 file changed +31
-0
lines changed
src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/failing
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com.fasterxml.jackson.module.kotlin.test.github
2
+
3
+ import com.fasterxml.jackson.databind.ObjectMapper
4
+ import com.fasterxml.jackson.module.kotlin.KotlinModule
5
+ import com.fasterxml.jackson.module.kotlin.readValue
6
+ import org.junit.Test
7
+ import kotlin.test.assertEquals
8
+
9
+ class OwnerRequestTest {
10
+ private val jackson = ObjectMapper ().registerModule(KotlinModule ())
11
+
12
+ val json = """ {"foo": "Got a foo"}"""
13
+
14
+ class NoIsField (val foo : String? = null )
15
+
16
+ class IsField (val foo : String? = null ) {
17
+ val isFoo = foo != null
18
+ }
19
+
20
+ @Test
21
+ fun testDeserHit340 () {
22
+ val value: IsField = jackson.readValue(json)
23
+ assertEquals(" Got a foo" , value.foo)
24
+ }
25
+
26
+ @Test
27
+ fun testDeserWithoutIssue () {
28
+ val value: NoIsField = jackson.readValue(json)
29
+ assertEquals(" Got a foo" , value.foo)
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments