Enum Class BeanOverrideStrategy
java.lang.Object
java.lang.Enum<BeanOverrideStrategy>
org.springframework.test.context.bean.override.BeanOverrideStrategy
- All Implemented Interfaces:
Serializable
,Comparable<BeanOverrideStrategy>
,Constable
Strategies for bean override processing.
- Since:
- 6.2
- Author:
- Simon Baslé, Stephane Nicoll
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionReplace a given bean definition, immediately preparing a singleton instance.Replace or create a given bean definition, immediately preparing a singleton instance.Intercept and process an early bean reference rather than a bean definition, allowing variants of bean overriding to wrap the instance — for example, to delegate to actual methods in the context of a mocking "spy". -
Method Summary
Modifier and TypeMethodDescriptionstatic BeanOverrideStrategy
Returns the enum constant of this class with the specified name.static BeanOverrideStrategy[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
REPLACE_DEFINITION
Replace a given bean definition, immediately preparing a singleton instance.Fails if the original bean definition exists. To create a new bean definition in such a case, use
REPLACE_OR_CREATE_DEFINITION
. -
REPLACE_OR_CREATE_DEFINITION
Replace or create a given bean definition, immediately preparing a singleton instance.Contrary to
REPLACE_DEFINITION
, this creates a new bean definition if the target bean definition does not exist rather than failing. -
WRAP_BEAN
Intercept and process an early bean reference rather than a bean definition, allowing variants of bean overriding to wrap the instance — for example, to delegate to actual methods in the context of a mocking "spy".
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-