批注接口 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
- 另请参阅:
-
可选元素概要
可选元素修饰符和类型可选元素说明booleanIf filters from the application context should be registered with MockMVC.HowMvcResultinformation should be printed after each MockMVC invocation.booleanIfMvcResultinformation should be printed only if the test fails.booleanIf aWebClientshould be auto-configured when HtmlUnit is on the classpath.booleanIf aWebDrivershould 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
HowMvcResultinformation should be printed after each MockMVC invocation.- 返回:
- how information is printed
- 默认值:
DEFAULT
-
printOnlyOnFailure
boolean printOnlyOnFailureIfMvcResultinformation should be printed only if the test fails.- 返回:
trueif printing only occurs on failure
- 默认值:
true
-
webClientEnabled
If aWebClientshould be auto-configured when HtmlUnit is on the classpath. Defaults totrue.- 返回:
- if a
WebClientis auto-configured
- 默认值:
true
-
webDriverEnabled
If aWebDrivershould be auto-configured when Selenium is on the classpath. Defaults totrue.- 返回:
- if a
WebDriveris auto-configured
- 默认值:
true
-