assertEquals("value", deepObject.getDeepObject().getName());
}
@Test
public void testMapBackedDeepMapping_TwoLevels() {
DeepObject deepObject = newInstance(DeepObject.class);
DeepObject firstLevel = newInstance(DeepObject.class);
deepObject.setDeepObject(firstLevel);
DeepObject hangingReference = newInstance(DeepObject.class);
firstLevel.setDeepObject(hangingReference);
HashMap<String, String> map = newInstance(HashMap.class);
map.put("data1", "value");
assertNotNull(deepObject.getDeepObject().getDeepObject());
assertNull(deepObject.getDeepObject().getDeepObject().getName());
mapper.map(map, deepObject, "TC2");
assertEquals("value", hangingReference.getName());
assertNotNull(deepObject.getDeepObject());
assertNotNull(deepObject.getDeepObject().getDeepObject());
assertEquals("value", deepObject.getDeepObject().getDeepObject().getName());
}