Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 736 Bytes

File metadata and controls

28 lines (22 loc) · 736 Bytes

Filter Registrations

When setting up a MockMvc instance, you can register one or more Servlet Filter instances, as the following example shows:

Java
mockMvc = standaloneSetup(new PersonController()).addFilters(new CharacterEncodingFilter()).build();
Kotlin
// Not possible in Kotlin until https://youtrack.jetbrains.com/issue/KT-22208 is fixed

Registered filters are invoked through the MockFilterChain from spring-test, and the last filter delegates to the DispatcherServlet.