Skip to content

Commit

Permalink
Fix "failing failing" test for #396
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 16, 2023
1 parent bedb6ea commit 85d9cf6
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ import kotlin.test.assertEquals

class TestGithub396 {
/**
* Succeeds in Jackson 2.11.x, but fails in Jackson 2.12.0
* Succeeds in Jackson 2.11.x, but fails in Jackson 2.12.0.
* But succeeds again in 2.15.0.
*
* See https://github.com/FasterXML/jackson-module-kotlin/issues/396
*/
@Test
fun testMissingConstructor() {
val mapper = XmlMapper().registerKotlinModule()

val xml = "<product><stuff></stuff></product>"
expectFailure<MismatchedInputException>("GitHub #396 has been fixed!") {
val product: Product = mapper.readValue(xml, Product::class.java)
val product: Product = mapper.readValue(xml, Product::class.java)

assertEquals(Product(null), product)
}
assertEquals(Product(Stuff(null)), product)
}

private data class Stuff(val str: String?)
Expand Down

0 comments on commit 85d9cf6

Please sign in to comment.