I’m using spring 3. I would use the beans configuration I have in my webapp (WEB-INF/app-context ..etc) in my integration tests.
is that possible? What do I need to add to my test context (IntegrationText-context.xml) (if that’s the right place) to do it?
I’ve tried @ContextConfiguration(locations={"classpath:WEB-INF/app-context/*.xml") in code but I get FileNotFound..
Essentially I’m trying to reuse the config of the webapp in an integration test.
Just place your appcontext in your regular classpath.
Add a new context to your WEB-INF that imports your appcontext from your classpath. So your context in the WEB-INF only wraps your standard context. The wrapper can be initiated through the web.xml and your unit test has access to the standard file.
Use
in your wrapper context for loading the real context.