File tree 2 files changed +32
-3
lines changed
src/test/kotlin/com/fasterxml/jackson/integtest/kotlin
2 files changed +32
-3
lines changed Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
3
- <modelVersion >4.0.0</modelVersion >
3
+ <modelVersion >4.0.0</modelVersion >
4
4
<parent >
5
5
<groupId >com.fasterxml.jackson</groupId >
6
6
<artifactId >jackson-base</artifactId >
199
199
<exclude >com/fasterxml/jackson/failing/*.java</exclude >
200
200
</excludes >
201
201
</configuration >
202
- </plugin >
202
+ </plugin >
203
203
<plugin >
204
204
<groupId >net.alchim31.maven</groupId >
205
205
<artifactId >scala-maven-plugin</artifactId >
228
228
<executions >
229
229
<execution >
230
230
<id >test-compile</id >
231
- <goals > <goal >test-compile</goal > </goals >
231
+ <goals >
232
+ <goal >test-compile</goal >
233
+ </goals >
232
234
<configuration >
233
235
<sourceDirs >
234
236
<sourceDir >${project.basedir} /src/test/kotlin</sourceDir >
Original file line number Diff line number Diff line change
1
+ import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule
2
+ import com.fasterxml.jackson.dataformat.xml.XmlFactory
3
+ import com.fasterxml.jackson.dataformat.xml.XmlMapper
4
+ import com.fasterxml.jackson.integtest.BaseTest
5
+ import com.fasterxml.jackson.module.kotlin.registerKotlinModule
6
+ import javax.xml.stream.XMLInputFactory
7
+
8
+ class Jackson212MissingConstructorTest : BaseTest ()
9
+ {
10
+ /* *
11
+ * Succeeds in Jackson 2.11.x, but fails in Jackson 2.12.0
12
+ * See https://github.com/FasterXML/jackson-module-kotlin/issues/396
13
+ */
14
+ fun testMissingConstructor ()
15
+ {
16
+ val factory = XmlFactory (XMLInputFactory .newInstance())
17
+ val mapper = XmlMapper (factory, JacksonXmlModule ()).registerKotlinModule()
18
+
19
+ val xml = " <product><stuff></stuff></product>"
20
+ val product: Product = mapper.readValue(xml, Product ::class .java)
21
+
22
+ assertEquals(Product (null ), product)
23
+ }
24
+
25
+ private data class Stuff (val str : String? )
26
+ private data class Product (val stuff : Stuff ? )
27
+ }
You can’t perform that action at this time.
0 commit comments