File tree 2 files changed +30
-1
lines changed
src/test/kotlin/com/fasterxml/jackson/module/kotlin/test
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change
1
+ package com.fasterxml.jackson.module.kotlin.test.failing
2
+
3
+ import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule
4
+ import com.fasterxml.jackson.dataformat.xml.XmlFactory
5
+ import com.fasterxml.jackson.dataformat.xml.XmlMapper
6
+ import com.fasterxml.jackson.module.kotlin.registerKotlinModule
7
+ import javax.xml.stream.XMLInputFactory
8
+ import kotlin.test.Test
9
+ import kotlin.test.assertEquals
10
+
11
+ class TestGithub396 {
12
+ /* *
13
+ * Succeeds in Jackson 2.11.x, but fails in Jackson 2.12.0
14
+ * See https://github.com/FasterXML/jackson-module-kotlin/issues/396
15
+ */
16
+ @Test
17
+ fun testMissingConstructor () {
18
+ val factory = XmlFactory (XMLInputFactory .newInstance())
19
+ val mapper = XmlMapper (factory, JacksonXmlModule ()).registerKotlinModule()
20
+
21
+ val xml = " <product><stuff></stuff></product>"
22
+ val product: Product = mapper.readValue(xml, Product ::class .java)
23
+
24
+ assertEquals(Product (null ), product)
25
+ }
26
+
27
+ private data class Stuff (val str : String? )
28
+ private data class Product (val stuff : Stuff ? )
29
+ }
Original file line number Diff line number Diff line change 1
- package com.fasterxml.jackson.module.kotlin.test.failing
1
+ package com.fasterxml.jackson.module.kotlin.test.github
2
2
3
3
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
4
4
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
You can’t perform that action at this time.
0 commit comments