Annotation Interface InfraTest


Annotation that can be specified on a test class that runs Infra based tests. Provides the following features over and above the regular Infra TestContext Framework:
从以下版本开始:
4.0
作者:
Phillip Webb, Andy Wilkinson
另请参阅:
  • 嵌套类概要

    嵌套类
    修饰符和类型
    说明
    static enum 
    An enumeration web environment modes.
  • 可选元素概要

    可选元素
    修饰符和类型
    可选元素
    说明
    Application arguments that should be passed to the application under test.
    Class<?>[]
    The component classes to use for loading an ApplicationContext.
    Properties in form key=value that should be added to the Infra Environment before the test runs.
    Alias for properties().
    The type of web environment to create when applicable.
  • 元素详细资料

    • value

      @AliasFor("properties") String[] value
      Alias for properties().
      返回:
      the properties to apply
      默认值:
      {}
    • properties

      @AliasFor("value") String[] properties
      Properties in form key=value that should be added to the Infra Environment before the test runs.
      返回:
      the properties to add
      默认值:
      {}
    • args

      String[] args
      Application arguments that should be passed to the application under test.
      返回:
      the application arguments to pass to the application under test.
      另请参阅:
      • ApplicationArguments
      • Application.run(String...)
      默认值:
      {}
    • classes

      Class<?>[] classes
      The component classes to use for loading an ApplicationContext. Can also be specified using @ContextConfiguration(classes=...). If no explicit classes are defined the test will look for nested @Configuration classes, before falling back to a @InfraConfiguration search.
      返回:
      the component classes used to load the application context
      另请参阅:
      默认值:
      {}
    • webEnvironment

      InfraTest.WebEnvironment webEnvironment
      The type of web environment to create when applicable. Defaults to InfraTest.WebEnvironment.MOCK.
      返回:
      the type of web environment
      默认值:
      MOCK