Skip to content

Commit 831c7a0

Browse files
committed
Add failing test for #4417
1 parent 6d7ade7 commit 831c7a0

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

src/test/java/com/fasterxml/jackson/failing/RecursiveIgnoreProperties1755Test.java

+23-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
import java.math.BigDecimal;
44
import java.util.List;
55

6+
import org.junit.jupiter.api.Test;
7+
68
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
79

810
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;
915

10-
public class RecursiveIgnoreProperties1755Test extends BaseMapTest
16+
public class RecursiveIgnoreProperties1755Test extends DatabindTestUtil
1117
{
1218
// for [databind#1755]
1319
static class JackBase1755 {
@@ -29,10 +35,16 @@ static class KeyValue {
2935
public String value;
3036
}
3137

32-
// for [databind#1755]
38+
// for [databind#4417]
39+
static class Item4417 {
40+
@JsonIgnoreProperties({ "whatever" })
41+
public List<Item4417> items;
42+
}
3343

3444
private final ObjectMapper MAPPER = newJsonMapper();
3545

46+
// for [databind#1755]
47+
@Test
3648
public void testRecursiveIgnore1755() throws Exception
3749
{
3850
final String JSON = a2q("{\n"
@@ -62,4 +74,13 @@ public void testRecursiveIgnore1755() throws Exception
6274
JackExt value = MAPPER.readValue(JSON, JackExt.class);
6375
assertNotNull(value);
6476
}
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+
}
6586
}

0 commit comments

Comments
 (0)