
Originally Posted by
Marten Deinum
A Unit test should be stripped from the outside world (even Spring) as much as possible. So you would just create a new instance of your controller, Mock or Stub the dependencies and then run the test. (You don't mess around with modifying your xml files).
If you want to do a integration test then instead of your production jdbc you use a stripped down version of it, preferably the same database but if needed an in memory database (just include a different datasource from a different infrastructure xml file). You can do the same for web testing, simply use an embedded instance of Jetty, tell it where to look for files and you can run an integration test for your web application, just include a dummy datasource and you can test everything. The developers don't even have to click the links anymore, they would have to write the testcase (just once).
That way you don't have to mess around each time, saves you a lot of time and you could even use Continues integration to test everything. If you have to change files each time this would be impossible.