批注接口 AutoConfigureMockMvc
@Target({TYPE,METHOD})
@Retention(RUNTIME)
@Documented
@Inherited
@ImportAutoConfiguration
@PropertyMapping("spring.test.mockmvc")
public @interface AutoConfigureMockMvc
Annotation that can be applied to a test class to enable and configure
auto-configuration of
MockMvc
. If AssertJ is available a MockMvcTester
is auto-configured as well.- 从以下版本开始:
- 1.4.0
- 作者:
- Phillip Webb
- 另请参阅:
-
可选元素概要
可选元素修饰符和类型可选元素说明boolean
If filters from the application context should be registered with MockMVC.HowMvcResult
information should be printed after each MockMVC invocation.boolean
IfMvcResult
information should be printed only if the test fails.boolean
If aWebClient
should be auto-configured when HtmlUnit is on the classpath.boolean
If aWebDriver
should be auto-configured when Selenium is on the classpath.
-
元素详细资料
-
addFilters
boolean addFiltersIf filters from the application context should be registered with MockMVC. Defaults totrue
.- 返回:
- if filters should be added
- 默认值:
true
-
print
HowMvcResult
information should be printed after each MockMVC invocation.- 返回:
- how information is printed
- 默认值:
DEFAULT
-
printOnlyOnFailure
boolean printOnlyOnFailureIfMvcResult
information should be printed only if the test fails.- 返回:
true
if printing only occurs on failure
- 默认值:
true
-
webClientEnabled
If aWebClient
should be auto-configured when HtmlUnit is on the classpath. Defaults totrue
.- 返回:
- if a
WebClient
is auto-configured
- 默认值:
true
-
webDriverEnabled
If aWebDriver
should be auto-configured when Selenium is on the classpath. Defaults totrue
.- 返回:
- if a
WebDriver
is auto-configured
- 默认值:
true
-