Add AotServices class to replace AotFactoriesLoader
Add an `AotServices` class to replace `AotFactoriesLoader`. The replacement class allow instances to be loaded from just the `aot.factories` file if required. It also retains a link to the bean names so that a `findByBeanName(...)` method can be provided. See gh-28833
This commit is contained in:
@@ -29,7 +29,7 @@ import org.springframework.aot.generate.MethodReference;
|
||||
import org.springframework.aot.test.generator.compile.Compiled;
|
||||
import org.springframework.aot.test.generator.compile.TestCompiler;
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.factory.aot.AotFactoriesLoader;
|
||||
import org.springframework.beans.factory.aot.AotServices;
|
||||
import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution;
|
||||
import org.springframework.beans.factory.aot.BeanRegistrationAotProcessor;
|
||||
import org.springframework.beans.factory.aot.TestBeanRegistrationsAotProcessor;
|
||||
@@ -77,7 +77,7 @@ class ScopedProxyBeanRegistrationAotProcessorTests {
|
||||
|
||||
@Test
|
||||
void scopedProxyBeanRegistrationAotProcessorIsRegistered() {
|
||||
assertThat(new AotFactoriesLoader(this.beanFactory).load(BeanRegistrationAotProcessor.class))
|
||||
assertThat(AotServices.factoriesAndBeans(this.beanFactory).load(BeanRegistrationAotProcessor.class))
|
||||
.anyMatch(ScopedProxyBeanRegistrationAotProcessor.class::isInstance);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user