接口的使用
org.springframework.test.web.servlet.setup.MockMvcConfigurer
使用MockMvcConfigurer的程序包 程序包 说明 org.springframework.test.web.servlet.htmlunit Server-side support for testing Spring MVC applications withMockMvc
and HtmlUnit.org.springframework.test.web.servlet.htmlunit.webdriver Server-side support for testing Spring MVC applications withMockMvc
and the SeleniumHtmlUnitDriver
.org.springframework.test.web.servlet.setup Contains built-inMockMvcBuilder
implementations.org.springframework.test.web.servlet.htmlunit中MockMvcConfigurer的使用
参数类型为MockMvcConfigurer的org.springframework.test.web.servlet.htmlunit中的方法 修饰符和类型 方法 说明 static MockMvcWebClientBuilder
MockMvcWebClientBuilder. webAppContextSetup(WebApplicationContext context, MockMvcConfigurer configurer)
Create a newMockMvcWebClientBuilder
based on the suppliedWebApplicationContext
andMockMvcConfigurer
.参数类型为MockMvcConfigurer的org.springframework.test.web.servlet.htmlunit中的构造器 构造器 说明 MockMvcWebClientBuilder(WebApplicationContext context, MockMvcConfigurer configurer)
MockMvcWebConnectionBuilderSupport(WebApplicationContext context, MockMvcConfigurer configurer)
Create a new instance using the suppliedWebApplicationContext
andMockMvcConfigurer
.org.springframework.test.web.servlet.htmlunit.webdriver中MockMvcConfigurer的使用
参数类型为MockMvcConfigurer的org.springframework.test.web.servlet.htmlunit.webdriver中的方法 修饰符和类型 方法 说明 static MockMvcHtmlUnitDriverBuilder
MockMvcHtmlUnitDriverBuilder. webAppContextSetup(WebApplicationContext context, MockMvcConfigurer configurer)
Create a newMockMvcHtmlUnitDriverBuilder
based on the suppliedWebApplicationContext
andMockMvcConfigurer
.参数类型为MockMvcConfigurer的org.springframework.test.web.servlet.htmlunit.webdriver中的构造器 构造器 说明 MockMvcHtmlUnitDriverBuilder(WebApplicationContext context, MockMvcConfigurer configurer)
org.springframework.test.web.servlet.setup中MockMvcConfigurer的使用
实现MockMvcConfigurer的org.springframework.test.web.servlet.setup中的类 修饰符和类型 类 说明 class
MockMvcConfigurerAdapter
An empty method implementation ofMockMvcConfigurer
.class
SharedHttpSessionConfigurer
MockMvcConfigurer
that stores and re-uses the HTTP session across multiple requests performed through the sameMockMvc
instance.参数类型为MockMvcConfigurer的org.springframework.test.web.servlet.setup中的方法 修饰符和类型 方法 说明 <T extends B>
TAbstractMockMvcBuilder. apply(MockMvcConfigurer configurer)
<T extends B>
TConfigurableMockMvcBuilder. apply(MockMvcConfigurer configurer)
Add aMockMvcConfigurer
that automates MockMvc setup and configures it for some specific purpose (e.g. security).