MockitoPostProcessor

A BeanFactoryPostProcessor used to register and inject @MockBeans with the ApplicationContext. An initial set of definitions can be passed to the processor with additional definitions being automatically created from @Configuration classes that use @MockBean.

Author

Phillip Webb

Andy Wilkinson

Stephane Nicoll

Andreas Neiser

Since

1.4.0

Constructors

Link copied to clipboard
constructor(definitions: Set<Definition>)
Create a new MockitoPostProcessor instance with the given initial definitions.

Properties

Link copied to clipboard
val HIGHEST_PRECEDENCE: Int = -2147483648
Link copied to clipboard
val LOWEST_PRECEDENCE: Int = 2147483647

Functions

Link copied to clipboard
open fun getOrder(): Int
Link copied to clipboard
open fun postProcessAfterInitialization(bean: Any, beanName: String): Any
Link copied to clipboard
open fun postProcessAfterInstantiation(bean: Any, beanName: String): Boolean
Link copied to clipboard
Link copied to clipboard
open fun postProcessBeforeInitialization(bean: Any, beanName: String): Any
Link copied to clipboard
open fun postProcessBeforeInstantiation(beanClass: Class<out Any>, beanName: String): Any
Link copied to clipboard
Link copied to clipboard
open fun register(registry: BeanDefinitionRegistry)
open fun register(registry: BeanDefinitionRegistry, definitions: Set<Definition>)
open fun register(registry: BeanDefinitionRegistry, postProcessor: Class<out MockitoPostProcessor>, definitions: Set<Definition>)
Register the processor with a BeanDefinitionRegistry.
Link copied to clipboard
open fun setBeanClassLoader(classLoader: ClassLoader)
Link copied to clipboard
open fun setBeanFactory(beanFactory: BeanFactory)