Polish "Update AOT tests to fail if deprecated code is not suppressed"

Include use of API that has been marked for removal.

See gh-48566
This commit is contained in:
Stéphane Nicoll
2025-12-17 15:41:26 +01:00
parent b6974ff51a
commit d489aa685c
7 changed files with 7 additions and 7 deletions
@@ -60,7 +60,7 @@ class SpringBootContextLoaderAotTests {
Class<?> testClass = ExampleTest.class;
generator.processAheadOfTime(Stream.of(testClass));
TestCompiler.forSystem()
.withCompilerOptions("-Xlint:deprecation", "-Werror")
.withCompilerOptions("-Xlint:deprecation,removal", "-Werror")
.with(CompilerFiles.from(generatedFiles))
.compile(ThrowingConsumer.of((compiled) -> assertCompiledTest(testClass)));
}
@@ -161,7 +161,7 @@ class ConfigurationPropertiesBeanRegistrationAotProcessorTests {
ClassName className = new ApplicationContextAotGenerator().processAheadOfTime(context, generationContext);
generationContext.writeGeneratedContent();
TestCompiler.forSystem()
.withCompilerOptions("-Xlint:deprecation", "-Werror")
.withCompilerOptions("-Xlint:deprecation,removal", "-Werror")
.with(generationContext)
.compile((compiled) -> {
GenericApplicationContext freshApplicationContext = new GenericApplicationContext();
@@ -308,7 +308,7 @@ class EnvironmentPostProcessorApplicationListenerTests {
new ApplicationContextAotGenerator().processAheadOfTime(context, generationContext);
generationContext.writeGeneratedContent();
TestCompiler.forSystem()
.withCompilerOptions("-Xlint:deprecation", "-Werror")
.withCompilerOptions("-Xlint:deprecation,removal", "-Werror")
.with(generationContext)
.compile(compiled);
}
@@ -88,7 +88,7 @@ class ResourceProviderCustomizerBeanRegistrationAotProcessorTests {
ClassName className = new ApplicationContextAotGenerator().processAheadOfTime(context, generationContext);
generationContext.writeGeneratedContent();
TestCompiler.forSystem()
.withCompilerOptions("-Xlint:deprecation", "-Werror")
.withCompilerOptions("-Xlint:deprecation,removal", "-Werror")
.with(generationContext)
.compile((compiled) -> {
GenericApplicationContext freshApplicationContext = new GenericApplicationContext();
@@ -107,7 +107,7 @@ class JacksonMixinModuleEntriesBeanRegistrationAotProcessorTests {
private void compile(BiConsumer<GenericApplicationContext, Compiled> result) {
ClassName className = processAheadOfTime();
TestCompiler.forSystem()
.withCompilerOptions("-Xlint:deprecation", "-Werror")
.withCompilerOptions("-Xlint:deprecation,removal", "-Werror")
.with(this.generationContext)
.compile((compiled) -> {
GenericApplicationContext freshApplicationContext = new GenericApplicationContext();
@@ -110,7 +110,7 @@ class JsonMixinModuleEntriesBeanRegistrationAotProcessorTests {
private void compile(BiConsumer<GenericApplicationContext, Compiled> result) {
ClassName className = processAheadOfTime();
TestCompiler.forSystem()
.withCompilerOptions("-Xlint:deprecation", "-Werror")
.withCompilerOptions("-Xlint:deprecation,removal", "-Werror")
.with(this.generationContext)
.compile((compiled) -> {
GenericApplicationContext freshApplicationContext = new GenericApplicationContext();
@@ -177,7 +177,7 @@ class ServletComponentScanRegistrarTests {
ClassName className = new ApplicationContextAotGenerator().processAheadOfTime(context, generationContext);
generationContext.writeGeneratedContent();
TestCompiler.forSystem()
.withCompilerOptions("-Xlint:deprecation", "-Werror")
.withCompilerOptions("-Xlint:deprecation,removal", "-Werror")
.with(generationContext)
.compile((compiled) -> {
GenericApplicationContext freshApplicationContext = new GenericApplicationContext();