类 MockitoPostProcessor
java.lang.Object
org.springframework.boot.test.mock.mockito.MockitoPostProcessor
- 所有已实现的接口:
Aware,BeanClassLoaderAware,BeanFactoryAware,BeanFactoryPostProcessor,BeanPostProcessor,InstantiationAwareBeanPostProcessor,Ordered
@Deprecated(since="3.4.0")
public class MockitoPostProcessor
extends Object
implements InstantiationAwareBeanPostProcessor, BeanClassLoaderAware, BeanFactoryAware, BeanFactoryPostProcessor, Ordered
已过时。
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.- 从以下版本开始:
- 1.4.0
- 作者:
- Phillip Webb, Andy Wilkinson, Stephane Nicoll, Andreas Neiser
-
字段概要
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器构造器说明MockitoPostProcessor(Set<org.springframework.boot.test.mock.mockito.Definition> definitions) 已过时。Create a newMockitoPostProcessorinstance with the given initial definitions. -
方法概要
修饰符和类型方法说明protected final ObjectcreateSpyIfNecessary(Object bean, String beanName) 已过时。intgetOrder()已过时。voidpostProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) 已过时。postProcessProperties(PropertyValues pvs, Object bean, String beanName) 已过时。static voidregister(BeanDefinitionRegistry registry) 已过时。Register the processor with aBeanDefinitionRegistry.static voidregister(BeanDefinitionRegistry registry, Class<? extends MockitoPostProcessor> postProcessor, Set<org.springframework.boot.test.mock.mockito.Definition> definitions) 已过时。Register the processor with aBeanDefinitionRegistry.static voidregister(BeanDefinitionRegistry registry, Set<org.springframework.boot.test.mock.mockito.Definition> definitions) 已过时。Register the processor with aBeanDefinitionRegistry.voidsetBeanClassLoader(ClassLoader classLoader) 已过时。voidsetBeanFactory(BeanFactory beanFactory) 已过时。从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 org.springframework.beans.factory.config.BeanPostProcessor
postProcessAfterInitialization, postProcessBeforeInitialization从接口继承的方法 org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor
postProcessAfterInstantiation, postProcessBeforeInstantiation
-
构造器详细资料
-
MockitoPostProcessor
已过时。Create a newMockitoPostProcessorinstance with the given initial definitions.- 参数:
definitions- the initial definitions
-
-
方法详细资料
-
setBeanClassLoader
已过时。- 指定者:
setBeanClassLoader在接口中BeanClassLoaderAware
-
setBeanFactory
已过时。- 指定者:
setBeanFactory在接口中BeanFactoryAware- 抛出:
BeansException
-
postProcessBeanFactory
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException 已过时。- 指定者:
postProcessBeanFactory在接口中BeanFactoryPostProcessor- 抛出:
BeansException
-
createSpyIfNecessary
已过时。- 抛出:
BeansException
-
postProcessProperties
public PropertyValues postProcessProperties(PropertyValues pvs, Object bean, String beanName) throws BeansException 已过时。 -
getOrder
public int getOrder()已过时。 -
register
已过时。Register the processor with aBeanDefinitionRegistry. Not required when using theSpringRunneras registration is automatic.- 参数:
registry- the bean definition registry
-
register
public static void register(BeanDefinitionRegistry registry, Set<org.springframework.boot.test.mock.mockito.Definition> definitions) 已过时。Register the processor with aBeanDefinitionRegistry. Not required when using theSpringRunneras registration is automatic.- 参数:
registry- the bean definition registrydefinitions- the initial mock/spy definitions
-
register
public static void register(BeanDefinitionRegistry registry, Class<? extends MockitoPostProcessor> postProcessor, Set<org.springframework.boot.test.mock.mockito.Definition> definitions) 已过时。Register the processor with aBeanDefinitionRegistry. Not required when using theSpringRunneras registration is automatic.- 参数:
registry- the bean definition registrypostProcessor- the post processor class to registerdefinitions- the initial mock/spy definitions
-
MockitoBeanandMockitoSpyBeansupport