Adapt to API change in Spring Framework
See https://github.com/spring-projects/spring-framework/issues/28927
This commit is contained in:
@@ -163,7 +163,7 @@ class ChildManagementContextInitializer
|
||||
public void applyTo(GenerationContext generationContext, BeanRegistrationCode beanRegistrationCode) {
|
||||
GenerationContext managementGenerationContext = generationContext.withName("Management");
|
||||
ClassName generatedInitializerClassName = new ApplicationContextAotGenerator()
|
||||
.generateApplicationContext(this.managementContext, managementGenerationContext);
|
||||
.processAheadOfTime(this.managementContext, managementGenerationContext);
|
||||
GeneratedMethod postProcessorMethod = beanRegistrationCode.getMethods().add("addManagementInitializer",
|
||||
(method) -> method.addJavadoc("Use AOT management context initialization")
|
||||
.addModifiers(Modifier.PRIVATE, Modifier.STATIC)
|
||||
|
||||
@@ -75,7 +75,7 @@ class ChildManagementContextInitializerAotTests {
|
||||
EndpointAutoConfiguration.class));
|
||||
contextRunner.withPropertyValues("server.port=0", "management.server.port=0").prepare((context) -> {
|
||||
TestGenerationContext generationContext = new TestGenerationContext(TestTarget.class);
|
||||
ClassName className = new ApplicationContextAotGenerator().generateApplicationContext(
|
||||
ClassName className = new ApplicationContextAotGenerator().processAheadOfTime(
|
||||
(GenericApplicationContext) context.getSourceApplicationContext(), generationContext);
|
||||
generationContext.writeGeneratedContent();
|
||||
TestCompiler compiler = TestCompiler.forSystem();
|
||||
|
||||
@@ -147,8 +147,7 @@ public class AotProcessor {
|
||||
DefaultGenerationContext generationContext = new DefaultGenerationContext(
|
||||
new ClassNameGenerator(this.application), generatedFiles);
|
||||
ApplicationContextAotGenerator generator = new ApplicationContextAotGenerator();
|
||||
ClassName generatedInitializerClassName = generator.generateApplicationContext(applicationContext,
|
||||
generationContext);
|
||||
ClassName generatedInitializerClassName = generator.processAheadOfTime(applicationContext, generationContext);
|
||||
registerEntryPointHint(generationContext, generatedInitializerClassName);
|
||||
generationContext.writeGeneratedContent();
|
||||
writeHints(generationContext.getRuntimeHints());
|
||||
|
||||
@@ -143,8 +143,7 @@ class ConfigurationPropertiesBeanRegistrationAotProcessorTests {
|
||||
@SuppressWarnings("unchecked")
|
||||
private void compile(GenericApplicationContext context, Consumer<GenericApplicationContext> freshContext) {
|
||||
TestGenerationContext generationContext = new TestGenerationContext(TestTarget.class);
|
||||
ClassName className = new ApplicationContextAotGenerator().generateApplicationContext(context,
|
||||
generationContext);
|
||||
ClassName className = new ApplicationContextAotGenerator().processAheadOfTime(context, generationContext);
|
||||
generationContext.writeGeneratedContent();
|
||||
TestCompiler.forSystem().withFiles(generationContext.getGeneratedFiles()).compile((compiled) -> {
|
||||
GenericApplicationContext freshApplicationContext = new GenericApplicationContext();
|
||||
|
||||
Reference in New Issue
Block a user