1 package com.fasterxml.jackson.failing; 2 3 import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 import com.fasterxml.jackson.annotation.JsonProperty; 5 import com.fasterxml.jackson.databind.BaseMapTest; 6 import com.fasterxml.jackson.databind.ObjectMapper; 7 8 public class JsonIgnoreProperties2803Test extends BaseMapTest 9 { 10 // [databind#2803] 11 static class Building2803 { 12 @JsonIgnoreProperties({"something"}) 13 @JsonProperty 14 private Room2803 lobby; 15 } 16 17 static class Museum2803 extends Building2803 { 18 } 19 20 static class Room2803 { 21 public Building2803 something; 22 public String id; 23 } 24 25 private final ObjectMapper MAPPER = newJsonMapper(); 26 27 // [databind#2803] testIgnoreProps2803()28 public void testIgnoreProps2803() throws Exception 29 { 30 final String DOC = "{\"lobby\":{\"id\":\"L1\"}}"; 31 32 // Important! Must do both calls, in this order 33 Museum2803 museum = MAPPER.readValue(DOC, Museum2803.class); 34 assertNotNull(museum); 35 //System.err.println(); 36 //System.err.println("------------------------------"); 37 //System.err.println(); 38 Building2803 building = MAPPER.readValue(DOC, Building2803.class); 39 assertNotNull(building); 40 } 41 } 42