Affects: 6.x
MockitoPostProcessor has been deprecated in Spring Boot. AOT processing of an application's tests generates code like this:
/**
* Get the bean definition for 'spyPostProcessor'.
*/
public static BeanDefinition getSpyPostProcessorBeanDefinition() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(MockitoPostProcessor.SpyPostProcessor.class);
beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
beanDefinition.getConstructorArgumentValues().addIndexedArgumentValue(0, new RuntimeBeanReference("org.springframework.boot.test.mock.mockito.MockitoPostProcessor"));
beanDefinition.setInstanceSupplier(getSpyPostProcessorInstanceSupplier());
return beanDefinition;
}
This results in a deprecation warning for MockitoPostProcessor.
Note that the generated code correctly suppresses warnings for using MockitoPostProcessor directly:
/**
* Get the bean definition for 'mockitoPostProcessor'.
*/
@SuppressWarnings("deprecation")
public static BeanDefinition getMockitoPostProcessorBeanDefinition() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(MockitoPostProcessor.class);
beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
beanDefinition.getConstructorArgumentValues().addIndexedArgumentValue(0, Collections.emptySet());
beanDefinition.setInstanceSupplier(getMockitoPostProcessorInstanceSupplier());
return beanDefinition;
}
Referring to the SpyPostProcessor nested class appears to be enough to throw off the deprecated API detection.
Affects: 6.x
MockitoPostProcessorhas been deprecated in Spring Boot. AOT processing of an application's tests generates code like this:This results in a deprecation warning for
MockitoPostProcessor.Note that the generated code correctly suppresses warnings for using
MockitoPostProcessordirectly:Referring to the
SpyPostProcessornested class appears to be enough to throw off the deprecated API detection.