Skip to content

Commit 784bdd4

Browse files
authored
Merge pull request #983 from FasterXML/2.19
2.19
2 parents 5ac5c75 + d1f80a7 commit 784bdd4

File tree

1 file changed

+17
-13
lines changed
  • src/test/kotlin/com/fasterxml/jackson/module/kotlin/kogeraIntegration/deser/valueClass

1 file changed

+17
-13
lines changed

src/test/kotlin/com/fasterxml/jackson/module/kotlin/kogeraIntegration/deser/valueClass/JacksonInjectTest.kt

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,28 @@ class JacksonInjectTest {
3131

3232
@Test
3333
fun test() {
34-
val injectables = InjectableValues.Std(
35-
mapOf(
36-
"pNn" to Primitive(0),
37-
"pN" to Primitive(1),
38-
"nnoNn" to NonNullObject("nnoNn"),
39-
"nnoN" to NonNullObject("nnoN"),
40-
"noNnNn" to NullableObject("noNnNn"),
41-
"noNnN" to NullableObject(null),
42-
"noNNn" to NullableObject("noNNn"),
43-
"noNN" to NullableObject(null)
44-
)
34+
val injectables = mapOf(
35+
"pNn" to Primitive(0),
36+
"pN" to Primitive(1),
37+
"nnoNn" to NonNullObject("nnoNn"),
38+
"nnoN" to NonNullObject("nnoN"),
39+
"noNnNn" to NullableObject("noNnNn"),
40+
"noNnN" to NullableObject(null),
41+
"noNNn" to NullableObject("noNNn"),
42+
"noNN" to NullableObject(null)
4543
)
4644

4745
val reader = jacksonObjectMapper()
4846
.readerFor(Dto::class.java)
49-
.with(injectables)
47+
.with(InjectableValues.Std(injectables))
48+
49+
val result = reader.readValue<Dto>("{}")
50+
val expected = ::Dto.let { ctor ->
51+
val args = ctor.parameters.associateWith { injectables[it.name] }
52+
ctor.callBy(args)
53+
}
5054

51-
println(reader.readValue<Dto>("{}"))
55+
assertEquals(expected, result)
5256
}
5357

5458
data class DataBind4218FailingDto(

0 commit comments

Comments
 (0)