批注接口 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
作者:
Phillip Webb
另请参阅:
  • 可选元素概要

    可选元素
    修饰符和类型
    可选元素
    说明
    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.