Skip to content

Commit 51727b4

Browse files
committed
Update Github474 test for Kotlin 2.4+
1 parent 229aaef commit 51727b4

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

  • src/test/kotlin/io/github/projectmapk/jackson/module/kogera/zPorted/test/github/failing

src/test/kotlin/io/github/projectmapk/jackson/module/kogera/zPorted/test/github/failing/Github474.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,24 @@ import org.junit.jupiter.api.Assertions.assertEquals
77
import org.junit.jupiter.api.Test
88

99
class TestGithub474 {
10+
open class Parent(@JsonProperty("parent-prop") val parent: String)
11+
class Child(@JsonProperty("child-prop") val child: String) : Parent(child)
12+
1013
@Test
1114
fun jsonPropertyAnnotationRespectedOnParentClass() {
12-
open class Parent(@JsonProperty("parent-prop") val parent: String)
13-
class Child(@JsonProperty("child-prop") val child: String) : Parent(child)
14-
15-
expectFailure<AssertionError>("GitHub #474 has been fixed!") {
15+
val assertion = {
1616
assertEquals(
1717
"""{"child-prop":"foo","parent-prop":"foo"}""",
1818
defaultMapper.writeValueAsString(Child("foo"))
1919
)
2020
}
21+
22+
if (KotlinVersion(2, 4) <= KotlinVersion.CURRENT) {
23+
assertion()
24+
} else {
25+
expectFailure<AssertionError>("GitHub #474 has been fixed!") {
26+
assertion()
27+
}
28+
}
2129
}
2230
}

0 commit comments

Comments
 (0)