|
|
@ -252,11 +252,12 @@ public class MockitoPostProcessor implements InstantiationAwareBeanPostProcessor
|
|
|
|
Set<String> beans = new LinkedHashSet<>(
|
|
|
|
Set<String> beans = new LinkedHashSet<>(
|
|
|
|
Arrays.asList(beanFactory.getBeanNamesForType(resolvableType, true, false)));
|
|
|
|
Arrays.asList(beanFactory.getBeanNamesForType(resolvableType, true, false)));
|
|
|
|
Class<?> type = resolvableType.resolve(Object.class);
|
|
|
|
Class<?> type = resolvableType.resolve(Object.class);
|
|
|
|
|
|
|
|
String typeName = type.getName();
|
|
|
|
for (String beanName : beanFactory.getBeanNamesForType(FactoryBean.class, true, false)) {
|
|
|
|
for (String beanName : beanFactory.getBeanNamesForType(FactoryBean.class, true, false)) {
|
|
|
|
beanName = BeanFactoryUtils.transformedBeanName(beanName);
|
|
|
|
beanName = BeanFactoryUtils.transformedBeanName(beanName);
|
|
|
|
BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName);
|
|
|
|
BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName);
|
|
|
|
Object attribute = beanDefinition.getAttribute(FactoryBean.OBJECT_TYPE_ATTRIBUTE);
|
|
|
|
Object attribute = beanDefinition.getAttribute(FactoryBean.OBJECT_TYPE_ATTRIBUTE);
|
|
|
|
if (resolvableType.equals(attribute) || type.equals(attribute)) {
|
|
|
|
if (resolvableType.equals(attribute) || type.equals(attribute) || typeName.equals(attribute)) {
|
|
|
|
beans.add(beanName);
|
|
|
|
beans.add(beanName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|