MockMvc should prepare a FilterRegistration when initializing filters #33252
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
MockMvc supports calling
init(FilterConfig)
on filters added to it with URL mappings and/or init params and dispatcher types. This was done in 6.1 with #31362.A filter that's being initialized may in turn try to access the
FilterRegistration
. Currently that's not initialized, and that can cause problems. For example:We can update
MockServletContext
to support addingFilterRegistration
s, and then make sure that's added in MockMvc along with theFilterConfig
it prepares.The text was updated successfully, but these errors were encountered: