@Test
    public void testCustomBeanFactory() {
        // -----------------------------------------------------------
        // Test that java beans get created with explicitly specified
        // custom bean factory
        // -----------------------------------------------------------

        Mapper mapper = DozerBeanMapperBuilder.create()
                .withMappingFiles("mappings/customfactorymapping.xml")
                .build();

        TestObjectPrime prime = mapper.map(testDataFactory.getInputGeneralMappingTestObject(), TestObjectPrime.class);
        TestObject source = mapper.map(prime, TestObject.class);

        // The following asserts will verify that the ClassMap beanFactory attr gets applied to both classes
        assertNotNull("created by factory name should not be null", prime.getCreatedByFactoryName());
        assertNotNull("created by factory name should not be null", source.getCreatedByFactoryName());
        assertEquals(SampleCustomBeanFactory.class.getName(), prime.getCreatedByFactoryName());
        assertEquals(SampleCustomBeanFactory.class.getName(), source.getCreatedByFactoryName());

        // The following asserts will verify that default configuration is being applied
        assertNotNull("created by factory name should not be null", source.getThree().getCreatedByFactoryName());
        assertEquals(SampleDefaultBeanFactory.class.getName(), source.getThree().getCreatedByFactoryName());

        // The following asserts will verify that dest or src class level attr's override classMap and default config attr's
        assertNotNull("created by factory name should not be null", prime.getThreePrime().getCreatedByFactoryName());
        assertEquals(SampleCustomBeanFactory2.class.getName(), prime.getThreePrime().getCreatedByFactoryName());

        // test returning an Interface
        Van van = new Van();
        van.setName("testName");
        MetalThingyIF car = mapper.map(van, MetalThingyIF.class);
        assertEquals("testName", car.getName());
    }
Very high level tests of the DozerBeanMapper. This test class is not intended to provide in-depth testing of all the
possible mapping use cases. The more in-depth unit tests of the DozerBeanMapper and MappingProcessor can be found in
other test classes within this same package. i.e) GranularDozerBeanMapperTest, MapperTest, IndexMappingTest, etc
core/src/test/java/com/github/dozermapper/core/functional_tests/DozerBeanMapperTest.java