Interface MockMvcConfigurer
- All Known Implementing Classes:
MockMvcConfigurerAdapter
public interface MockMvcConfigurer
Allows a sub-class to encapsulate logic for pre-configuring aConfigurableMockMvcBuilderfor some specific purpose. A 3rd party library may use this to provide shortcuts for setting up MockMvc.Can be plugged in via
ConfigurableMockMvcBuilder.apply(org.springframework.test.web.servlet.setup.MockMvcConfigurer)with instances of this type likely created via static methods, e.g.:MockMvcBuilders.webAppContextSetup(context).apply(mySetup("foo","bar")).build();- Since:
- 4.1
- Author:
- Rossen Stoyanchev
- See Also:
MockMvcConfigurerAdapter
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidafterConfigurerAdded(ConfigurableMockMvcBuilder<?> builder)Invoked immediately after aMockMvcConfigureris added viaConfigurableMockMvcBuilder.apply(org.springframework.test.web.servlet.setup.MockMvcConfigurer).RequestPostProcessorbeforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder, WebApplicationContext context)Invoked just before the MockMvc instance is created.
Method Detail
afterConfigurerAdded
void afterConfigurerAdded(ConfigurableMockMvcBuilder<?> builder)
Invoked immediately after aMockMvcConfigureris added viaConfigurableMockMvcBuilder.apply(org.springframework.test.web.servlet.setup.MockMvcConfigurer).
beforeMockMvcCreated
RequestPostProcessor beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder, WebApplicationContext context)
Invoked just before the MockMvc instance is created. Implementations may return a RequestPostProcessor to be applied to every request performed through the createdMockMvcinstance.