Polishing
This commit is contained in:
parent
79b0d71514
commit
580d9f81e2
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -517,9 +517,9 @@ public class AutowiredAnnotationBeanPostProcessor implements SmartInstantiationA
|
|||
}
|
||||
|
||||
/**
|
||||
* 'Native' processing method for direct calls with an arbitrary target instance,
|
||||
* resolving all of its fields and methods which are annotated with one of the
|
||||
* configured 'autowired' annotation types.
|
||||
* <em>Native</em> processing method for direct calls with an arbitrary target
|
||||
* instance, resolving all of its fields and methods which are annotated with
|
||||
* one of the configured 'autowired' annotation types.
|
||||
* @param bean the target instance to process
|
||||
* @throws BeanCreationException if autowiring failed
|
||||
* @see #setAutowiredAnnotationTypes(Set)
|
||||
|
|
|
@ -153,7 +153,7 @@ public class DependencyInjectionTestExecutionListener extends AbstractTestExecut
|
|||
}
|
||||
|
||||
Object bean = testContext.getTestInstance();
|
||||
Class<?> clazz = testContext.getTestClass();
|
||||
String beanName = testContext.getTestClass().getName() + AutowireCapableBeanFactory.ORIGINAL_INSTANCE_SUFFIX;
|
||||
|
||||
ConfigurableListableBeanFactory beanFactory = gac.getBeanFactory();
|
||||
AutowiredAnnotationBeanPostProcessor autowiredAnnotationBpp = new AutowiredAnnotationBeanPostProcessor();
|
||||
|
@ -162,7 +162,7 @@ public class DependencyInjectionTestExecutionListener extends AbstractTestExecut
|
|||
CommonAnnotationBeanPostProcessor commonAnnotationBpp = new CommonAnnotationBeanPostProcessor();
|
||||
commonAnnotationBpp.setBeanFactory(beanFactory);
|
||||
commonAnnotationBpp.processInjection(bean);
|
||||
beanFactory.initializeBean(bean, clazz.getName() + AutowireCapableBeanFactory.ORIGINAL_INSTANCE_SUFFIX);
|
||||
beanFactory.initializeBean(bean, beanName);
|
||||
testContext.removeAttribute(REINJECT_DEPENDENCIES_ATTRIBUTE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue