Class BeanOverrideUtils

java.lang.Object
org.springframework.test.context.bean.override.BeanOverrideUtils

public abstract class BeanOverrideUtils extends Object
Utility methods for working with bean overrides.

Primarily intended for use within the framework.

Since:
7.1
Author:
Sam Brannen
  • Constructor Details

    • BeanOverrideUtils

      public BeanOverrideUtils()
  • Method Details

    • findHandlersForFields

      public static List<BeanOverrideHandler> findHandlersForFields(Class<?> testClass)
      Process the given testClass and build the corresponding BeanOverrideHandler list derived from @BeanOverride fields in the test class and its type hierarchy.

      This method does not search the enclosing class hierarchy and does not search for @BeanOverride declarations on classes or interfaces.

      Parameters:
      testClass - the test class to process
      Returns:
      a list of bean override handlers
      See Also:
    • findAllHandlers

      public static List<BeanOverrideHandler> findAllHandlers(Class<?> testClass)
      Process the given testClass and build the corresponding BeanOverrideHandler list derived from @BeanOverride fields in the test class and in its type hierarchy as well as from @BeanOverride declarations on classes and interfaces.

      This method additionally searches for @BeanOverride declarations in the enclosing class hierarchy based on TestContextAnnotationUtils.searchEnclosingClass(Class) semantics.

      Parameters:
      testClass - the test class to process
      Returns:
      a list of bean override handlers
      See Also: