I am trying to unit test a webapp that I am developing in Maven/Eclipse. It is a Spring MVC webapp, and I need some unit tests to test my model controller.
To do thi
To do this, I need to use my webapp config .xml files to inject the controller, however, all my configuration (and other associated files that the configs reference) are in the src/main/webapp directory
What are those files that you also need during unit tests exactly?
I do not want to have to copy my entire webapp in to my src/test/resources folder just for the purpose of testing - is there any other way to be able to access them?
No. If you want them to be on the classpath, put them either in src/main/resources
or src/test/resources
, files under src/main/webapp
are not on the classpath because they're not supposed to.