@@ -6,10 +6,8 @@ import com.fasterxml.jackson.annotation.JsonProperty
6
6
import com.fasterxml.jackson.databind.InjectableValues
7
7
import com.fasterxml.jackson.databind.ObjectMapper
8
8
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
9
- import kotlin.math.exp
10
9
import org.junit.jupiter.api.Test
11
10
import kotlin.test.assertEquals
12
- import kotlin.test.assertNotEquals
13
11
14
12
class Github722 {
15
13
data class FailingDto @JsonCreator constructor(
@@ -39,11 +37,13 @@ class Github722 {
39
37
@Test
40
38
fun failing () {
41
39
// 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)
44
42
.with (InjectableValues .Std (injectValues))
45
- .readValue<FailingDto >(" {}" )
43
+ val result = reader .readValue<FailingDto >(" {}" )
46
44
45
+ // fixed
46
+ // assertNotEquals(result, expected, "GitHubXXX fixed.")
47
47
assertEquals(expected, result)
48
48
}
49
49
@@ -56,10 +56,10 @@ class Github722 {
56
56
57
57
@Test
58
58
fun withoutDefaultValue () {
59
- val kotlinMapper = jacksonObjectMapper()
60
- val result = kotlinMapper .readerFor(WithoutDefaultValue ::class .java)
59
+ val reader = jacksonObjectMapper()
60
+ .readerFor(WithoutDefaultValue ::class .java)
61
61
.with (InjectableValues .Std (injectValues))
62
- .readValue<WithoutDefaultValue >(" {}" )
62
+ val result = reader .readValue<WithoutDefaultValue >(" {}" )
63
63
64
64
// If there is no default value, the problem does not occur.
65
65
assertEquals(WithoutDefaultValue (1 , 2 ), result)
0 commit comments