Package org.springframework.test.context.bean.override

# Annotation Interface BeanOverride

@Retention(RUNTIME) @Target(ANNOTATION_TYPE) @Documented @Reflective(org.springframework.test.context.bean.override.BeanOverrideReflectiveProcessor.class) public @interface BeanOverride
Mark a composed annotation as eligible for Bean Override processing.

Specifying this annotation registers the configured `BeanOverrideProcessor` which must be capable of handling the composed annotation and its attributes.

Since the composed annotation will typically only be applied to non-static fields, it is expected that the composed annotation is meta-annotated with `@Target(ElementType.FIELD)`. However, certain bean override annotations may be declared with an additional `ElementType.TYPE` target for use at the type level, as is the case for `@MockitoBean` which can be declared on a field, test class, or test interface.

For concrete examples of such composed annotations, see `@TestBean`, `@MockitoBean`, and `@MockitoSpyBean`.

Since:
  6.2
Author:
  Simon Baslé, Sam Brannen

## Required Element Summary

Required Elements
Modifier and Type
Required Element
Description
`Class<? extends BeanOverrideProcessor>`
`value`
The `BeanOverrideProcessor` implementation to use.

## Element Details

### value

Class<? extends BeanOverrideProcessor> value
The `BeanOverrideProcessor` implementation to use.