public class DefaultMockMvcBuilder extends AbstractMockMvcBuilder<DefaultMockMvcBuilder>
AbstractMockMvcBuilder that provides
the WebApplicationContext supplied to it as a constructor argument.
In addition, if the ServletContext in the supplied
WebApplicationContext does not contain an entry for the
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
key, the root WebApplicationContext will be detected and stored
in the ServletContext under the
ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE key.
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultMockMvcBuilder(org.springframework.web.context.WebApplicationContext webAppContext)
Protected constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.web.context.WebApplicationContext |
initWebAppContext()
A method to obtain the WebApplicationContext to be passed to the DispatcherServlet.
|
addFilter, addFilters, alwaysDo, alwaysExpect, apply, build, defaultRequest, dispatchOptionscreateMockMvcprotected DefaultMockMvcBuilder(org.springframework.web.context.WebApplicationContext webAppContext)
protected org.springframework.web.context.WebApplicationContext initWebAppContext()
AbstractMockMvcBuilderAbstractMockMvcBuilder.build() before the
MockMvc instance is created.initWebAppContext in class AbstractMockMvcBuilder<DefaultMockMvcBuilder>