Skip to content

Commit 7107d31

Browse files
committed
Refactor test
1 parent dbe31ab commit 7107d31

File tree

1 file changed

+8
-8
lines changed
  • src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/github

1 file changed

+8
-8
lines changed

src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/github/Github722.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ import com.fasterxml.jackson.annotation.JsonProperty
66
import com.fasterxml.jackson.databind.InjectableValues
77
import com.fasterxml.jackson.databind.ObjectMapper
88
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
9-
import kotlin.math.exp
109
import org.junit.jupiter.api.Test
1110
import kotlin.test.assertEquals
12-
import kotlin.test.assertNotEquals
1311

1412
class 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

Comments
 (0)