File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
src/test/java/com/fasterxml/jackson/failing Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .failing ;
2
+
3
+ import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
4
+ import com .fasterxml .jackson .databind .*;
5
+ import com .fasterxml .jackson .databind .annotation .JsonDeserialize ;
6
+
7
+ public class BuilderWithIgnored1214Test extends BaseMapTest
8
+ {
9
+ @ JsonDeserialize (builder = TestObject1214 .Builder .class )
10
+ @ JsonIgnoreProperties (ignoreUnknown = true )
11
+ static class TestObject1214 {
12
+ final String property1 ;
13
+
14
+ private TestObject1214 (Builder builder ) {
15
+ property1 = builder .property1 ;
16
+ }
17
+
18
+ public static Builder builder () {
19
+ return new Builder ();
20
+ }
21
+
22
+ public String getProperty1 () {
23
+ return property1 ;
24
+ }
25
+
26
+ static class Builder {
27
+
28
+ private String property1 ;
29
+
30
+ public Builder withProperty1 (String p1 ) {
31
+ property1 = p1 ;
32
+ return this ;
33
+ }
34
+
35
+ public TestObject1214 build () {
36
+ return new TestObject1214 (this );
37
+ }
38
+ }
39
+ }
40
+
41
+ public void testUnknown1214 () throws Exception
42
+ {
43
+ ObjectMapper mapper = new ObjectMapper ();
44
+ TestObject1214 value = mapper .readValue (aposToQuotes
45
+ ("{'property1':'a', 'property2':'b'}" ),
46
+ TestObject1214 .class );
47
+ assertEquals ("a" , value .property1 );
48
+ }
49
+ }
You can’t perform that action at this time.
0 commit comments