Adapt to upstream Spring Framework AOT changes
This commit is contained in:
parent
b68e43f5fd
commit
57e967576e
|
@ -27,7 +27,6 @@ import org.springframework.beans.factory.BeanFactory;
|
||||||
import org.springframework.beans.factory.aot.BeanRegistrationAotContribution;
|
import org.springframework.beans.factory.aot.BeanRegistrationAotContribution;
|
||||||
import org.springframework.beans.factory.aot.BeanRegistrationAotProcessor;
|
import org.springframework.beans.factory.aot.BeanRegistrationAotProcessor;
|
||||||
import org.springframework.beans.factory.aot.BeanRegistrationCode;
|
import org.springframework.beans.factory.aot.BeanRegistrationCode;
|
||||||
import org.springframework.beans.factory.aot.BeanRegistrationExcludeFilter;
|
|
||||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||||
import org.springframework.beans.factory.support.RegisteredBean;
|
import org.springframework.beans.factory.support.RegisteredBean;
|
||||||
import org.springframework.boot.LazyInitializationBeanFactoryPostProcessor;
|
import org.springframework.boot.LazyInitializationBeanFactoryPostProcessor;
|
||||||
|
@ -57,8 +56,8 @@ import org.springframework.util.Assert;
|
||||||
* @author Andy Wilkinson
|
* @author Andy Wilkinson
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
*/
|
*/
|
||||||
class ChildManagementContextInitializer implements ApplicationListener<WebServerInitializedEvent>,
|
class ChildManagementContextInitializer
|
||||||
BeanRegistrationAotProcessor, BeanRegistrationExcludeFilter {
|
implements ApplicationListener<WebServerInitializedEvent>, BeanRegistrationAotProcessor {
|
||||||
|
|
||||||
private final ManagementContextFactory managementContextFactory;
|
private final ManagementContextFactory managementContextFactory;
|
||||||
|
|
||||||
|
@ -103,7 +102,7 @@ class ChildManagementContextInitializer implements ApplicationListener<WebServer
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isExcluded(RegisteredBean registeredBean) {
|
public boolean isBeanExcludedFromAotProcessing() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
package org.springframework.boot.autoconfigure.template;
|
package org.springframework.boot.autoconfigure.template;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -24,8 +23,7 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.aot.hint.RuntimeHints;
|
import org.springframework.aot.hint.RuntimeHints;
|
||||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
|
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
|
||||||
import org.springframework.beans.factory.aot.AotFactoriesLoader;
|
import org.springframework.beans.factory.aot.AotServices;
|
||||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
|
||||||
import org.springframework.boot.test.context.FilteredClassLoader;
|
import org.springframework.boot.test.context.FilteredClassLoader;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
|
||||||
|
@ -43,8 +41,7 @@ class TemplateRuntimeHintsTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void templateRuntimeHintsIsRegistered() {
|
void templateRuntimeHintsIsRegistered() {
|
||||||
List<RuntimeHintsRegistrar> registrar = new AotFactoriesLoader(new DefaultListableBeanFactory())
|
Iterable<RuntimeHintsRegistrar> registrar = AotServices.factories().load(RuntimeHintsRegistrar.class);
|
||||||
.load(RuntimeHintsRegistrar.class);
|
|
||||||
assertThat(registrar).anyMatch(TemplateRuntimeHints.class::isInstance);
|
assertThat(registrar).anyMatch(TemplateRuntimeHints.class::isInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ import org.springframework.aot.hint.RuntimeHints;
|
||||||
import org.springframework.aot.hint.TypeHint;
|
import org.springframework.aot.hint.TypeHint;
|
||||||
import org.springframework.aot.hint.TypeReference;
|
import org.springframework.aot.hint.TypeReference;
|
||||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
|
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
|
||||||
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.BeanFactoryInitializationAotContribution;
|
||||||
import org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor;
|
import org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor;
|
||||||
import org.springframework.beans.factory.aot.BeanFactoryInitializationCode;
|
import org.springframework.beans.factory.aot.BeanFactoryInitializationCode;
|
||||||
|
@ -63,9 +63,8 @@ class ConfigurationPropertiesBeanFactoryInitializationAotProcessorTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void configurationPropertiesBeanFactoryInitializationAotProcessorIsRegistered() {
|
void configurationPropertiesBeanFactoryInitializationAotProcessorIsRegistered() {
|
||||||
assertThat(new AotFactoriesLoader(new DefaultListableBeanFactory())
|
assertThat(AotServices.factories().load(BeanFactoryInitializationAotProcessor.class))
|
||||||
.load(BeanFactoryInitializationAotProcessor.class))
|
.anyMatch(ConfigurationPropertiesBeanFactoryInitializationAotProcessor.class::isInstance);
|
||||||
.anyMatch(ConfigurationPropertiesBeanFactoryInitializationAotProcessor.class::isInstance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -18,7 +18,7 @@ package org.springframework.boot.context.properties;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.aot.AotFactoriesLoader;
|
import org.springframework.beans.factory.aot.AotServices;
|
||||||
import org.springframework.beans.factory.aot.BeanRegistrationAotContribution;
|
import org.springframework.beans.factory.aot.BeanRegistrationAotContribution;
|
||||||
import org.springframework.beans.factory.aot.BeanRegistrationAotProcessor;
|
import org.springframework.beans.factory.aot.BeanRegistrationAotProcessor;
|
||||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||||
|
@ -40,7 +40,7 @@ class ConfigurationPropertiesBeanRegistrationAotProcessorTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void configurationPropertiesBeanRegistrationAotProcessorIsRegistered() {
|
void configurationPropertiesBeanRegistrationAotProcessorIsRegistered() {
|
||||||
assertThat(new AotFactoriesLoader(new DefaultListableBeanFactory()).load(BeanRegistrationAotProcessor.class))
|
assertThat(AotServices.factories().load(BeanRegistrationAotProcessor.class))
|
||||||
.anyMatch(ConfigurationPropertiesBeanRegistrationAotProcessor.class::isInstance);
|
.anyMatch(ConfigurationPropertiesBeanRegistrationAotProcessor.class::isInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue