Class DefaultMockMvcBuilder
java.lang.Object
org.springframework.test.web.servlet.MockMvcBuilderSupport
org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder<DefaultMockMvcBuilder>
org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder
- All Implemented Interfaces:
MockMvcBuilder, ConfigurableMockMvcBuilder<DefaultMockMvcBuilder>
A concrete implementation of
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.
- Since:
- 3.2
- Author:
- Rossen Stoyanchev, Rob Winch, Sam Brannen
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultMockMvcBuilder(WebApplicationContext webAppContext) Protected constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected WebApplicationContextA method to obtain theWebApplicationContextto be passed to theDispatcherServlet.Methods inherited from class AbstractMockMvcBuilder
addDispatcherServletCustomizer, addFilter, addFilter, addFilters, alwaysDo, alwaysExpect, apiVersionInserter, apply, build, defaultRequest, defaultResponseCharacterEncoding, dispatchOptions, selfMethods inherited from class MockMvcBuilderSupport
createMockMvc, createMockMvc
-
Constructor Details
-
DefaultMockMvcBuilder
Protected constructor. Not intended for direct instantiation.- See Also:
-
-
Method Details
-
initWebAppContext
Description copied from class:AbstractMockMvcBuilderA method to obtain theWebApplicationContextto be passed to theDispatcherServlet. Invoked fromAbstractMockMvcBuilder.build()before theMockMvcinstance is created.- Specified by:
initWebAppContextin classAbstractMockMvcBuilder<DefaultMockMvcBuilder>
-