类 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
public class DefaultMockMvcBuilder extends AbstractMockMvcBuilder<DefaultMockMvcBuilder>
A concrete implementation ofAbstractMockMvcBuilder
that provides theWebApplicationContext
supplied to it as a constructor argument.In addition, if the
ServletContext
in the suppliedWebApplicationContext
does not contain an entry for theWebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
key, the rootWebApplicationContext
will be detected and stored in theServletContext
under theROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
key.- 从以下版本开始:
- 3.2
- 作者:
- Rossen Stoyanchev, Rob Winch, Sam Brannen
构造器概要
构造器 限定符 构造器 说明 protected
DefaultMockMvcBuilder(WebApplicationContext webAppContext)
Protected constructor.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected WebApplicationContext
initWebAppContext()
A method to obtain the WebApplicationContext to be passed to the DispatcherServlet.从类继承的方法 org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
addDispatcherServletCustomizer, addFilter, addFilters, alwaysDo, alwaysExpect, apply, build, defaultRequest, dispatchOptions
从类继承的方法 org.springframework.test.web.servlet.MockMvcBuilderSupport
createMockMvc, createMockMvc
构造器详细资料
DefaultMockMvcBuilder
protected DefaultMockMvcBuilder(WebApplicationContext webAppContext)
Protected constructor. Not intended for direct instantiation.
方法详细资料
initWebAppContext
protected WebApplicationContext initWebAppContext()
从类复制的说明:AbstractMockMvcBuilder
A method to obtain the WebApplicationContext to be passed to the DispatcherServlet. Invoked fromAbstractMockMvcBuilder.build()
before theMockMvc
instance is created.