• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.fasterxml.jackson.databind.struct;
2 
3 import com.fasterxml.jackson.annotation.JsonBackReference;
4 import com.fasterxml.jackson.annotation.JsonManagedReference;
5 
6 import com.fasterxml.jackson.databind.BaseMapTest;
7 import com.fasterxml.jackson.databind.ObjectMapper;
8 
9 /**
10  * @author Reda.Housni-Alaoui
11  */
12 public class BackReference1878Test extends BaseMapTest
13 {
14     static class Child {
15         @JsonBackReference
16         public Parent b;
17     }
18 
19     static class Parent {
20         @JsonManagedReference
21         public Child a;
22     }
23 
24     private final ObjectMapper MAPPER = new ObjectMapper();
25 
testChildDeserialization()26     public void testChildDeserialization() throws Exception {
27         Child child = MAPPER.readValue("{\"b\": {}}", Child.class);
28         assertNotNull(child.b);
29     }
30 }
31