@Test
    public void testCustomMappingForAbstractClasses() {
        // Test that the explicit abstract custom mapping definition is used when mapping sub classes
        mapper = getMapper("mappings/abstractMapping.xml");

        A src = getA();
        B dest = mapper.map(src, B.class);

        assertNull("abstractField1 should have been excluded", dest.getAbstractField1());
        assertEquals("abstractBField not mapped correctly", src.getAbstractAField(), dest.getAbstractBField());
        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);
    }
Unit tests for data objects that have Abstract Class(s) in their object hierarchy
core/src/test/java/com/github/dozermapper/core/functional_tests/InheritanceAbstractClassMappingTest.java