批注接口 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.
    How MvcResult information should be printed after each MockMVC invocation.
    boolean
    If MvcResult information should be printed only if the test fails.
    boolean
    If a WebClient should be auto-configured when HtmlUnit is on the classpath.
    boolean
    If a WebDriver should be auto-configured when Selenium is on the classpath.
  • 元素详细资料

    • addFilters

      boolean addFilters
      If filters from the application context should be registered with MockMVC. Defaults to true.
      返回:
      if filters should be added
      默认值:
      true
    • print

      How MvcResult information should be printed after each MockMVC invocation.
      返回:
      how information is printed
      默认值:
      DEFAULT
    • printOnlyOnFailure

      boolean printOnlyOnFailure
      If MvcResult information should be printed only if the test fails.
      返回:
      true if printing only occurs on failure
      默认值:
      true
    • webClientEnabled

      @PropertyMapping("webclient.enabled") boolean webClientEnabled
      If a WebClient should be auto-configured when HtmlUnit is on the classpath. Defaults to true.
      返回:
      if a WebClient is auto-configured
      默认值:
      true
    • webDriverEnabled

      @PropertyMapping("webdriver.enabled") boolean webDriverEnabled
      If a WebDriver should be auto-configured when Selenium is on the classpath. Defaults to true.
      返回:
      if a WebDriver is auto-configured
      默认值:
      true