File tree 1 file changed +50
-0
lines changed
src/test/java/com/fasterxml/jackson/failing
1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .failing ;
2
+
3
+ import java .beans .ConstructorProperties ;
4
+
5
+ import com .fasterxml .jackson .annotation .JsonIgnore ;
6
+
7
+ import com .fasterxml .jackson .databind .*;
8
+
9
+ public class Ignore1317Test extends BaseMapTest
10
+ {
11
+ static class Testing {
12
+ @ JsonIgnore
13
+ public String ignore ;
14
+
15
+ String notIgnore ;
16
+
17
+ public Testing () {}
18
+
19
+ @ ConstructorProperties ({"ignore" , "notIgnore" })
20
+ public Testing (String ignore , String notIgnore ) {
21
+ super ();
22
+ this .ignore = ignore ;
23
+ this .notIgnore = notIgnore ;
24
+ }
25
+
26
+ public String getIgnore () {
27
+ return ignore ;
28
+ }
29
+
30
+ public void setIgnore (String ignore ) {
31
+ this .ignore = ignore ;
32
+ }
33
+
34
+ public String getNotIgnore () {
35
+ return notIgnore ;
36
+ }
37
+
38
+ public void setNotIgnore (String notIgnore ) {
39
+ this .notIgnore = notIgnore ;
40
+ }
41
+ }
42
+
43
+ public void testThatJsonIgnoreWorksWithConstructorProperties () throws Exception {
44
+ Testing testing = new Testing ("shouldBeIgnored" , "notIgnore" );
45
+ ObjectMapper om = new ObjectMapper ();
46
+ String json = om .writeValueAsString (testing );
47
+ System .out .println (json );
48
+ assertFalse (json .contains ("shouldBeIgnored" ));
49
+ }
50
+ }
You can’t perform that action at this time.
0 commit comments