@@ -6,10 +6,8 @@ import com.fasterxml.jackson.annotation.JsonProperty
66import  com.fasterxml.jackson.databind.InjectableValues 
77import  com.fasterxml.jackson.databind.ObjectMapper 
88import  com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 
9- import  kotlin.math.exp 
109import  org.junit.jupiter.api.Test 
1110import  kotlin.test.assertEquals 
12- import  kotlin.test.assertNotEquals 
1311
1412class  Github722  {
1513    data class  FailingDto  @JsonCreator constructor(
@@ -39,11 +37,13 @@ class Github722 {
3937    @Test
4038    fun  failing () {
4139        //  The kotlin mapper uses the Kotlin default value instead of the Inject value.
42-         val  kotlinMapper  =  jacksonObjectMapper()
43-         val  result  =  kotlinMapper .readerFor(FailingDto ::class .java)
40+         val  reader  =  jacksonObjectMapper()
41+              .readerFor(FailingDto ::class .java)
4442            .with (InjectableValues .Std (injectValues))
45-              .readValue<FailingDto >(" {}" 
43+         val  result  =  reader .readValue<FailingDto >(" {}" 
4644
45+         //  fixed
46+         //  assertNotEquals(result, expected, "GitHubXXX fixed.")
4747        assertEquals(expected, result)
4848    }
4949
@@ -56,10 +56,10 @@ class Github722 {
5656
5757    @Test
5858    fun  withoutDefaultValue () {
59-         val  kotlinMapper  =  jacksonObjectMapper()
60-         val  result  =  kotlinMapper .readerFor(WithoutDefaultValue ::class .java)
59+         val  reader  =  jacksonObjectMapper()
60+              .readerFor(WithoutDefaultValue ::class .java)
6161            .with (InjectableValues .Std (injectValues))
62-              .readValue<WithoutDefaultValue >(" {}" 
62+         val  result  =  reader .readValue<WithoutDefaultValue >(" {}" 
6363
6464        //  If there is no default value, the problem does not occur.
6565        assertEquals(WithoutDefaultValue (1 , 2 ), result)
0 commit comments