title: Spring @Controller Unittest @RequestMapping
body: <p>Having a basic Spring Contoller i'd like to Unittest the Request Mapping (not the Method itself), if the <code>doCriticalStuff</code> Method is indeed called</p>
  
  <pre><code>package org.foo;
  
  @Controller
  public class HelloWorldController implements IHelloWorldController
  {
     @RequestMapping(value = "/b/c/", method = RequestMethod.GET)
     public void doCriticalStuff(HttpServletRequest request, HttpServletResponse response){
        //...
     }
  }
  </code></pre>
  
  <p>Right now I'm doging this via <code>curl -X GET http://myIP:myPort/b/c/</code> 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?</p>
  
  <p>Related Post: <a href="https://stackoverflow.com/questions/2319845/how-to-test-binders-property-editors-used-on-spring-2-5-controllers">How to test binders/property editors used on spring 2.5 controllers</a></p>