Annotation Type 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 aTypeExcludeFilter
is declared as anexcludeFilter
.- Since:
- 1.4.0
- See Also:
TypeExcludeFilter
,TestConfiguration