Skip to content

Commit d9c7a75

Browse files
authored
Merge pull request #432 from ProjectMapK/k163377-patch-2
Update Kotlin versions in test workflow
2 parents 7cfbb47 + 51727b4 commit d9c7a75

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

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

.github/workflows/test-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
# LTS versions, latest version (if exists)
4343
java-version: [ '17', '21', '25', '26' ]
4444
# Minimum version, latest release version, latest pre-release version (if exists)
45-
kotlin: ['2.1.21', '2.2.21', '2.3.20']
45+
kotlin: ['2.1.21', '2.2.21', '2.3.21', '2.4.0-Beta2']
4646
env:
4747
KOTLIN_VERSION: ${{ matrix.kotlin }}
4848
name: "Kotlin ${{ matrix.kotlin }} - Java ${{ matrix.java-version }}"

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)