DestBeanCreator { public <T> T create(Class<T> targetClass) { return (T)create(targetClass, null); } DestBeanCreator(BeanContainer beanContainer); T create(Class<T> targetClass); Object create(Class<?> targetClass, Class<?> alternateClass); Object create(BeanCreationDirective directive); void setStoredFactories(Map<String, BeanFactory> factories); void addPluggedStrategy(BeanCreationStrategy strategy);  }
@Test public void testCreatDestBeanNoFactory() { TestObject bean = (TestObject)destBeanCreator.create(new BeanCreationDirective(null, null, TestObject.class, null, null, null, null, null)); assertNotNull(bean); assertNull(bean.getCreatedByFactoryName()); }
@Test public void testCreatBeanFromFactory() { String factoryName = "com.github.dozermapper.core.functional_tests.support.SampleCustomBeanFactory"; TestObject bean = (TestObject)destBeanCreator.create( new BeanCreationDirective(new TestObjectPrime(), TestObjectPrime.class, TestObject.class, null, factoryName, null, null, null)); assertNotNull(bean); assertEquals(factoryName, bean.getCreatedByFactoryName()); }
@Test public void testMap() { Map map = destBeanCreator.create(Map.class); assertTrue(map instanceof HashMap); TreeMap treeMap = destBeanCreator.create(TreeMap.class); assertNotNull(treeMap); }