HandlerInterceptorAdapter Testing
We showed how to use HandlerInterceptorAdapter within your spring MVC application and as your mappings get more complicated you should consider writing unit tests to validate that the correct handler is being applied to URL. Spring Framework 3.2 release included first class support for testing Spring MVC applications is broken into two categories of tests; integration and mocking. The integration approach is more of full on integration test as it loads your entire configuration and the latter just mocks controllers without loading configuration. Since TestContext frameworks caches spring configuration your first test will take a hit but each one after should be fairly speedy. The example below will show how how to validate that a request contains a handler in the execution chain.