Class BeanOverrideUtils
java.lang.Object
org.springframework.test.context.bean.override.BeanOverrideUtils
Utility methods for working with bean overrides.
Primarily intended for use within the framework.
- Since:
- 7.1
- Author:
- Sam Brannen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<BeanOverrideHandler> findAllHandlers(Class<?> testClass) Process the giventestClassand build the correspondingBeanOverrideHandlerlist derived from@BeanOverridefields in the test class and in its type hierarchy as well as from@BeanOverridedeclarations on classes and interfaces.static List<BeanOverrideHandler> findHandlersForFields(Class<?> testClass) Process the giventestClassand build the correspondingBeanOverrideHandlerlist derived from@BeanOverridefields in the test class and its type hierarchy.
-
Constructor Details
-
BeanOverrideUtils
public BeanOverrideUtils()
-
-
Method Details
-
findHandlersForFields
Process the giventestClassand build the correspondingBeanOverrideHandlerlist derived from@BeanOverridefields in the test class and its type hierarchy.This method does not search the enclosing class hierarchy and does not search for
@BeanOverridedeclarations on classes or interfaces.- Parameters:
testClass- the test class to process- Returns:
- a list of bean override handlers
- See Also:
-
findAllHandlers
Process the giventestClassand build the correspondingBeanOverrideHandlerlist derived from@BeanOverridefields in the test class and in its type hierarchy as well as from@BeanOverridedeclarations on classes and interfaces.This method additionally searches for
@BeanOverridedeclarations in the enclosing class hierarchy based onTestContextAnnotationUtils.searchEnclosingClass(Class)semantics.- Parameters:
testClass- the test class to process- Returns:
- a list of bean override handlers
- See Also:
-