SpringSource/spring-framework — pull request #133 by rwinch (2012-08-31 18:26:47+00:00)
Title: Add MockFilterChain support Filter's and Servlet

Working on Spring Test MVC we have the need for a `MockFilterChain` that will invoke `Filter`'s and/or a `Servlet`. Since this is something that others would likely want, we thought it would be best to update the `MockFilterChain` provided by Spring Framework.

One item that should be highlighted is that the `doFilter` method signature now has throws `IOException`, `ServletException`. While both `Exception`s are on the `FilterChain` interface, this is non-passive for any user invoking `new MockFilterChain().doFilter()` since they would need to handle the newly added `Exception`s. However, since this is to only impact test code and is impossible to miss (due to the compiler) and easily fixable it was thought to be better than wrapping the `Exception`s with a `RuntimeException`.

Currently the MockFilterChain
- Performs basic validation on the request/response
- Makes the request/response available as members
- Ensures doFilter is only invoked once

This commit adds the ability to allow the MockFilterChain to invoke
a List of Filter's and/or a Servlet.

Issue: SPR-9745