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(WebApplicationContext webAppContext)
Protected constructor.
|
Modifier and Type | Method and Description |
---|---|
protected WebApplicationContext |
initWebAppContext()
A method to obtain the WebApplicationContext to be passed to the DispatcherServlet.
|
addFilter, addFilters, alwaysDo, alwaysExpect, apply, build, defaultRequest, dispatchOptions
createMockMvc
protected DefaultMockMvcBuilder(WebApplicationContext webAppContext)
protected WebApplicationContext initWebAppContext()
AbstractMockMvcBuilder
AbstractMockMvcBuilder.build()
before the
MockMvc
instance is created.initWebAppContext
in class AbstractMockMvcBuilder<DefaultMockMvcBuilder>