Interface BeanOverrideProcessor
BeanOverrideHandler instances that drive how target beans are
 overridden.
 At least one composed annotation that is meta-annotated with
 @BeanOverride must be a companion of this processor and
 may optionally provide annotation attributes that can be used to configure the
 BeanOverrideHandler.
 
Implementations are required to have a no-argument constructor and be stateless.
- Since:
- 6.2
- Author:
- Simon Baslé, Stephane Nicoll, Sam Brannen
- 
Method SummaryModifier and TypeMethodDescriptioncreateHandler(Annotation overrideAnnotation, Class<?> testClass, Field field) Create aBeanOverrideHandlerfor the given annotated field.default List<BeanOverrideHandler>createHandlers(Annotation overrideAnnotation, Class<?> testClass) Create a list ofBeanOverrideHandlerinstances for the given override annotation and test class.
- 
Method Details- 
createHandlerCreate aBeanOverrideHandlerfor the given annotated field.This method will only be invoked when a @BeanOverrideannotation is declared on a field — for example, if the supplied field is annotated with@MockitoBean.- Parameters:
- overrideAnnotation- the composed annotation that declares the- @BeanOverrideannotation which registers this processor
- testClass- the test class to process
- field- the annotated field
- Returns:
- the BeanOverrideHandlerthat should handle the given field
- See Also:
 
- 
createHandlersCreate a list ofBeanOverrideHandlerinstances for the given override annotation and test class.This method will only be invoked when a @BeanOverrideannotation is declared at the type level — for example, if the supplied test class is annotated with@MockitoBean.Note that the test class may not be directly annotated with the override annotation. For example, the override annotation may have been declared on an interface, superclass, or enclosing class within the test class hierarchy. The default implementation returns an empty list, signaling that this BeanOverrideProcessordoes not support type-level@BeanOverridedeclarations. Can be overridden by concrete implementations to support type-level use cases.- Parameters:
- overrideAnnotation- the composed annotation that declares the- @BeanOverrideannotation which registers this processor
- testClass- the test class to process
- Returns:
- the list of BeanOverrideHandlersfor the annotated class
- Since:
- 6.2.2
- See Also:
 
 
-