DozerBeanMapperFactoryBean extends ApplicationObjectSupport implements InitializingBean, FactoryBean<Mapper> { @Override public void afterPropertiesSet() { Map<String, CustomConverter> contextCustomConvertersWithId = getApplicationContext().getBeansOfType(CustomConverter.class); Map<String, BeanMappingBuilder> contextBeanMappingBuilders = getApplicationContext().getBeansOfType(BeanMappingBuilder.class); Map<String, EventListener> contextEventListeners = getApplicationContext().getBeansOfType(EventListener.class); Map<String, BeanFactory> contextBeanFactories = getApplicationContext().getBeansOfType(BeanFactory.class); Map<String, DozerBeanMapperBuilderCustomizer> contextBuilderCustomizers = getApplicationContext().getBeansOfType(DozerBeanMapperBuilderCustomizer.class); customConverters.addAll(contextCustomConvertersWithId.values()); mappingBuilders.addAll(contextBeanMappingBuilders.values()); beanFactories.putAll(contextBeanFactories); eventListeners.addAll(contextEventListeners.values()); customConvertersWithId.putAll(contextCustomConvertersWithId); builderCustomizers.addAll(contextBuilderCustomizers.values()); DozerBeanMapperBuilder builder = DozerBeanMapperBuilder.create() .withMappingFiles(mappingFileUrls) .withCustomFieldMapper(customFieldMapper) .withCustomConverters(customConverters) .withMappingBuilders(mappingBuilders) .withEventListeners(eventListeners) .withBeanFactorys(beanFactories) .withCustomConvertersWithIds(customConvertersWithId); builderCustomizers.forEach(customizer -> customizer.customize(builder)); this.mapper = builder.build(); }  void setCustomFieldMapper(CustomFieldMapper customFieldMapper); void setMappingFiles(Resource[] mappingFiles); void setCustomConverters(List<CustomConverter> customConverters); void setMappingBuilders(List<BeanMappingBuilder> mappingBuilders); void setEventListeners(List<EventListener> eventListeners); void setFactories(Map<String, BeanFactory> beanFactories); void setCustomConvertersWithId(Map<String, CustomConverter> customConvertersWithId); void setBuilderCustomizers(List<DozerBeanMapperBuilderCustomizer> builderCustomizers); @Override void afterPropertiesSet(); @Override Mapper getObject(); @Override Class<Mapper> getObjectType(); @Override boolean isSingleton();  }
@Test public void testEmpty() { factory.afterPropertiesSet(); }