File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/github/failing Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ wrongwrong (k163377@github)
29
29
* Contributed #438 : Fixed mapping failure when `private` `companion object` is named
30
30
(2.13 )
31
31
32
+ Marshall Pierce (marshallpierce @github )
33
+ * #474 : Reported disrespect for @JsonProperty on parent class
34
+ (2.12 .NEXT )
35
+
32
36
Christopher Mason (masoncj @github )
33
37
* #194 : Contributed test case for @JsonIdentityInfo usage
34
38
(2.12 .NEXT )
Original file line number Diff line number Diff line change
1
+ package com.fasterxml.jackson.module.kotlin.test.github.failing
2
+
3
+ import com.fasterxml.jackson.annotation.JsonProperty
4
+ import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
5
+ import com.fasterxml.jackson.module.kotlin.test.expectFailure
6
+ import org.junit.ComparisonFailure
7
+ import org.junit.Test
8
+ import kotlin.test.assertEquals
9
+
10
+ class TestGithub474 {
11
+ @Test
12
+ fun jsonPropertyAnnotationRespectedOnParentClass () {
13
+ open class Parent (@JsonProperty(" parent-prop" ) val parent : String )
14
+ class Child (@JsonProperty(" child-prop" ) val child : String ) : Parent(child)
15
+
16
+ expectFailure<ComparisonFailure >(" GitHub #474 has been fixed!" ) {
17
+ assertEquals(
18
+ """ {"child-prop":"foo","parent-prop":"foo"}""" ,
19
+ jacksonObjectMapper().writeValueAsString(Child (" foo" ))
20
+ )
21
+ }
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments