In the setup of my test cases, I have this code:
ApplicationContext context = new ClassPathXmlApplicationContext(
"spring/common.xml"
);
StaticListableBeanFactory testBeanFactory = new StaticListableBeanFactory();
How do I connect the two in such a way that tests can register beans in the testBeanFactory
during setup and the rest of the application uses them instead of the ones defined in common.xml
?
Note: I need to mix a static (common.xml) and a dynamic configuration. I can't use XML for the latter because that would mean to write > 1000 XML files.