BeanOverrideProcessor class final

The container hook that applies a list of BeanOverrides: after the bean definitions are registered, before any application bean is created.

springBootTest(overrides:) and ApplicationContextRunner.withBeanOverride add it for you; tests do not create it. It replaces the definitions in postProcessBeanFactory rather than earlier, so the beans that the application's own registry post-processors add can be replaced too.

Implemented types

Constructors

BeanOverrideProcessor(List<BeanOverride<Object>> overrides)
A processor that applies overrides.

Properties

hashCode → int
The hash code for this object.
no setterinherited
overrides → List<BeanOverride<Object>>
The overrides, applied in order: when two replace the same bean, the last wins.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) → void
Adds, removes or replaces definitions in registry. Runs before every BeanFactoryPostProcessor.postProcessBeanFactory, this processor's own included.
override
postProcessBeanFactory(ConfigurableListableBeanFactory factory) → void
Inspects or changes the definitions in beanFactory (scope, lazy, primary, ...). Avoid creating beans here: they would be created before the bean post-processors exist and miss their processing.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited