// -----------------------------------------------------------
Mapper mapper = getNewMapper(new String[]{"customfactorymapping.xml"});
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());