abstract fun <T : B> addFilter(filter: Filter, vararg urlPatterns: String): T
Add a filter mapped to a specific set of patterns. For example:
mockMvcBuilder.addFilters(myResourceFilter, "/resources/*");
is the equivalent of:
<filter-mapping> <filter-name>myResourceFilter</filter-name> <url-pattern>/resources/*</url-pattern> </filter-mapping>
Filters will be invoked in the order in which they are provided.
urlPatterns
- URL patterns to map to; if empty, "/*" is used by default