注释类型 TestComponent


  • @Target(TYPE)
    @Retention(RUNTIME)
    @Documented
    @Component
    public @interface TestComponent
    @Component that can be used when a bean is intended only for tests, and should be excluded from Spring Boot's component scanning.

    Note that if you directly use @ComponentScan rather than relying on @SpringBootApplication you should ensure that a TypeExcludeFilter is declared as an excludeFilter.

    从以下版本开始:
    1.4.0
    另请参阅:
    TypeExcludeFilter, TestConfiguration
    • 可选元素概要

      可选元素 
      修饰符和类型可选元素说明
      Stringvalue
      The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an auto-detected component.
    • 元素详细资料

      • value

        String value
        The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an auto-detected component.
        返回:
        the specified bean name, if any
        默认值:
        ""