Skip to content

Commit d489aa6

Browse files
committed
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
1 parent b6974ff commit d489aa6

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

core/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootContextLoaderAotTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void loadContextForAotProcessingAndAotRuntime() {
6060
Class<?> testClass = ExampleTest.class;
6161
generator.processAheadOfTime(Stream.of(testClass));
6262
TestCompiler.forSystem()
63-
.withCompilerOptions("-Xlint:deprecation", "-Werror")
63+
.withCompilerOptions("-Xlint:deprecation,removal", "-Werror")
6464
.with(CompilerFiles.from(generatedFiles))
6565
.compile(ThrowingConsumer.of((compiled) -> assertCompiledTest(testClass)));
6666
}

core/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBeanRegistrationAotProcessorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private void compile(GenericApplicationContext context, Consumer<GenericApplicat
161161
ClassName className = new ApplicationContextAotGenerator().processAheadOfTime(context, generationContext);
162162
generationContext.writeGeneratedContent();
163163
TestCompiler.forSystem()
164-
.withCompilerOptions("-Xlint:deprecation", "-Werror")
164+
.withCompilerOptions("-Xlint:deprecation,removal", "-Werror")
165165
.with(generationContext)
166166
.compile((compiled) -> {
167167
GenericApplicationContext freshApplicationContext = new GenericApplicationContext();

core/spring-boot/src/test/java/org/springframework/boot/support/EnvironmentPostProcessorApplicationListenerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ private void compile(GenericApplicationContext context, Consumer<Compiled> compi
308308
new ApplicationContextAotGenerator().processAheadOfTime(context, generationContext);
309309
generationContext.writeGeneratedContent();
310310
TestCompiler.forSystem()
311-
.withCompilerOptions("-Xlint:deprecation", "-Werror")
311+
.withCompilerOptions("-Xlint:deprecation,removal", "-Werror")
312312
.with(generationContext)
313313
.compile(compiled);
314314
}

module/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/ResourceProviderCustomizerBeanRegistrationAotProcessorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private void compile(GenericApplicationContext context, Consumer<GenericApplicat
8888
ClassName className = new ApplicationContextAotGenerator().processAheadOfTime(context, generationContext);
8989
generationContext.writeGeneratedContent();
9090
TestCompiler.forSystem()
91-
.withCompilerOptions("-Xlint:deprecation", "-Werror")
91+
.withCompilerOptions("-Xlint:deprecation,removal", "-Werror")
9292
.with(generationContext)
9393
.compile((compiled) -> {
9494
GenericApplicationContext freshApplicationContext = new GenericApplicationContext();

module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/JacksonMixinModuleEntriesBeanRegistrationAotProcessorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private ClassName processAheadOfTime() {
107107
private void compile(BiConsumer<GenericApplicationContext, Compiled> result) {
108108
ClassName className = processAheadOfTime();
109109
TestCompiler.forSystem()
110-
.withCompilerOptions("-Xlint:deprecation", "-Werror")
110+
.withCompilerOptions("-Xlint:deprecation,removal", "-Werror")
111111
.with(this.generationContext)
112112
.compile((compiled) -> {
113113
GenericApplicationContext freshApplicationContext = new GenericApplicationContext();

module/spring-boot-jackson2/src/test/java/org/springframework/boot/jackson2/JsonMixinModuleEntriesBeanRegistrationAotProcessorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private ClassName processAheadOfTime() {
110110
private void compile(BiConsumer<GenericApplicationContext, Compiled> result) {
111111
ClassName className = processAheadOfTime();
112112
TestCompiler.forSystem()
113-
.withCompilerOptions("-Xlint:deprecation", "-Werror")
113+
.withCompilerOptions("-Xlint:deprecation,removal", "-Werror")
114114
.with(this.generationContext)
115115
.compile((compiled) -> {
116116
GenericApplicationContext freshApplicationContext = new GenericApplicationContext();

module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrarTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ private void compile(GenericApplicationContext context, Consumer<GenericApplicat
177177
ClassName className = new ApplicationContextAotGenerator().processAheadOfTime(context, generationContext);
178178
generationContext.writeGeneratedContent();
179179
TestCompiler.forSystem()
180-
.withCompilerOptions("-Xlint:deprecation", "-Werror")
180+
.withCompilerOptions("-Xlint:deprecation,removal", "-Werror")
181181
.with(generationContext)
182182
.compile((compiled) -> {
183183
GenericApplicationContext freshApplicationContext = new GenericApplicationContext();

0 commit comments

Comments
 (0)