import org.junit.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; public class IngesterCircularReferencesTest { @Test public void circularReferencesTest() { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(); context.setAllowCircularReferences(false); String[] configLocations = new String[] { "/your-beans.xml" }; context.setConfigLocations(configLocations); context.refresh(); context.close(); } }
New ideas pass through three periods:
1) It can’t be done.
2) It probably can be done, but it’s not worth doing.
3) I knew it was a good idea all along!
- Arthur C. Clarke
Showing posts with label circular dependencies. Show all posts
Showing posts with label circular dependencies. Show all posts
Thursday, 19 June 2014
How to test circular dependencies in Spring
This will raise an exception if your dependencies have circular dependency problem
Subscribe to:
Posts (Atom)