From df0630b553cb056cfa498fcba724446cf3ef915d Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Fri, 28 Jan 2022 21:56:14 +0900 Subject: [PATCH] add test case --- .../jackson/module/kotlin/test/ParameterNameTests.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/ParameterNameTests.kt b/src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/ParameterNameTests.kt index 127b57bd..0b20c6da 100644 --- a/src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/ParameterNameTests.kt +++ b/src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/ParameterNameTests.kt @@ -209,6 +209,16 @@ class TestJacksonWithKotlin { assertThat(test1out, equalTo(pascalCasedJson)) } + private class HasSameParamNameConstructor(val value: Int) { + constructor(value: Short) : this(value.toInt() + 100) + } + + @Test fun findingPrimaryConstructor() { + val json = "{\"value\":1}" + + // If there is more than one constructor, the primary constructor will be used. + assertEquals(1, normalCasedMapper.readValue(json).value) + } // ==================