Skip to content

Commit 3f61f59

Browse files
committed
Failing test for Github 340
1 parent 02c07b1 commit 3f61f59

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 numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
}

0 commit comments

Comments
 (0)