Having a basic Spring Contoller i'd like to Unittest the Request Mapping (not the Method itself), if the doCriticalStuff
Method is indeed called
package org.foo;
@Controller
public class HelloWorldController implements IHelloWorldController
{
@RequestMapping(value = "/b/c/", method = RequestMethod.GET)
public void doCriticalStuff(HttpServletRequest request, HttpServletResponse response){
//...
}
}
Right now I'm doging this via curl -X GET http://myIP:myPort/b/c/
from commandline in a manual way.
Any Ideas on how to automate it?
I could setup a Jetty instance, send a request and see if i get the expected response but isn't there an easier way provided by Spring?
Related Post: How to test binders/property editors used on spring 2.5 controllers