spring-framework / org.springframework.test.web.servlet.setup / ConfigurableMockMvcBuilder / apply

apply

abstract fun <T : B> apply(configurer: MockMvcConfigurer): T

Add a MockMvcConfigurer that automates MockMvc setup and configures it for some specific purpose (e.g. security).

There is a built-in SharedHttpSessionConfigurer that can be used to re-use the HTTP session across requests. 3rd party frameworks like Spring Security also use this mechanism to provide configuration shortcuts.

See Also
SharedHttpSessionConfigurer