类 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 ofAbstractMockMvcBuilderthat provides theWebApplicationContextsupplied to it as a constructor argument.In addition, if the
ServletContextin the suppliedWebApplicationContextdoes not contain an entry for theWebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTEkey, the rootWebApplicationContextwill be detected and stored in theServletContextunder theROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTEkey.- 从以下版本开始:
- 3.2
- 作者:
- Rossen Stoyanchev, Rob Winch, Sam Brannen
构造器概要
构造器 限定符 构造器 说明 protectedDefaultMockMvcBuilder(WebApplicationContext webAppContext)Protected constructor.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected WebApplicationContextinitWebAppContext()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()
从类复制的说明:AbstractMockMvcBuilderA method to obtain the WebApplicationContext to be passed to the DispatcherServlet. Invoked fromAbstractMockMvcBuilder.build()before theMockMvcinstance is created.