3
3
import java .math .BigDecimal ;
4
4
import java .util .List ;
5
5
6
+ import org .junit .jupiter .api .Test ;
7
+
6
8
import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
7
9
8
10
import com .fasterxml .jackson .databind .*;
11
+ import com .fasterxml .jackson .databind .testutil .DatabindTestUtil ;
12
+
13
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
14
+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
9
15
10
- public class RecursiveIgnoreProperties1755Test extends BaseMapTest
16
+ public class RecursiveIgnoreProperties1755Test extends DatabindTestUtil
11
17
{
12
18
// for [databind#1755]
13
19
static class JackBase1755 {
@@ -29,10 +35,16 @@ static class KeyValue {
29
35
public String value ;
30
36
}
31
37
32
- // for [databind#1755]
38
+ // for [databind#4417]
39
+ static class Item4417 {
40
+ @ JsonIgnoreProperties ({ "whatever" })
41
+ public List <Item4417 > items ;
42
+ }
33
43
34
44
private final ObjectMapper MAPPER = newJsonMapper ();
35
45
46
+ // for [databind#1755]
47
+ @ Test
36
48
public void testRecursiveIgnore1755 () throws Exception
37
49
{
38
50
final String JSON = a2q ("{\n "
@@ -62,4 +74,13 @@ public void testRecursiveIgnore1755() throws Exception
62
74
JackExt value = MAPPER .readValue (JSON , JackExt .class );
63
75
assertNotNull (value );
64
76
}
77
+
78
+ // for [databind#4417]
79
+ @ Test
80
+ public void testRecursiveIgnore4417 () throws Exception
81
+ {
82
+ Item4417 result = MAPPER .readValue (a2q ("{'items': [{'items': []}]}" ),
83
+ Item4417 .class );
84
+ assertEquals (1 , result .items .size (), 1 );
85
+ }
65
86
}
0 commit comments