Class MockMvcConfigurerAdapter
- java.lang.Object
- org.springframework.test.web.servlet.setup.MockMvcConfigurerAdapter
- All Implemented Interfaces:
MockMvcConfigurer
public abstract class MockMvcConfigurerAdapter extends Object implements MockMvcConfigurer
An empty method implementation ofMockMvcConfigurer
.- Since:
- 4.1
- Author:
- Rossen Stoyanchev
Constructor Summary
Constructors Constructor Description MockMvcConfigurerAdapter()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterConfigurerAdded(ConfigurableMockMvcBuilder<?> builder)
Invoked immediately when thisMockMvcConfigurer
is added viaConfigurableMockMvcBuilder.apply(org.springframework.test.web.servlet.setup.MockMvcConfigurer)
.RequestPostProcessor
beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder, WebApplicationContext cxt)
Invoked when the MockMvc instance is about to be created with the MockMvc builder and the Spring WebApplicationContext that will be passed to theDispatcherServlet
.
Constructor Detail
MockMvcConfigurerAdapter
public MockMvcConfigurerAdapter()
Method Detail
afterConfigurerAdded
public void afterConfigurerAdded(ConfigurableMockMvcBuilder<?> builder)
Description copied from interface:MockMvcConfigurer
Invoked immediately when thisMockMvcConfigurer
is added viaConfigurableMockMvcBuilder.apply(org.springframework.test.web.servlet.setup.MockMvcConfigurer)
.- Specified by:
afterConfigurerAdded
in interfaceMockMvcConfigurer
- Parameters:
builder
- the builder for the MockMvc
beforeMockMvcCreated
@Nullable public RequestPostProcessor beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder, WebApplicationContext cxt)
Description copied from interface:MockMvcConfigurer
Invoked when the MockMvc instance is about to be created with the MockMvc builder and the Spring WebApplicationContext that will be passed to theDispatcherServlet
.- Specified by:
beforeMockMvcCreated
in interfaceMockMvcConfigurer
- Parameters:
builder
- the builder for the MockMvccxt
- the Spring configuration- Returns:
- a post processor to be applied to every request performed through the
MockMvc
instance.