@Test
public void testCustomMappingForSuperClasses() throws Exception {
// Test that the explicit super custom mapping definition is used when mapping sub classes
mapper = getMapper(new String[] { "inheritanceMapping.xml" });
A src = getA();
B dest = mapper.map(src, B.class);
assertNull("superField1 should have been excluded", dest.getSuperField1());
assertEquals("superBField not mapped correctly", src.getSuperAField(), dest.getSuperBField());
assertEquals("field1 not mapped correctly", src.getField1(), dest.getField1());
assertEquals("fieldB not mapped correctly", src.getFieldA(), dest.getFieldB());
// Remap to each other to test bi-directional mapping
A mappedSrc = mapper.map(dest, A.class);
B mappedDest = mapper.map(mappedSrc, B.class);
assertEquals("objects not mapped correctly bi-directional", dest, mappedDest);
}