diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessor.java index a403c36e58..7df92a2548 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessor.java @@ -129,6 +129,7 @@ public class ConfigDataEnvironmentPostProcessor implements EnvironmentPostProces getLegacyListener().addPropertySources(environment, resourceLoader); } + @SuppressWarnings("deprecation") LegacyConfigFileApplicationListener getLegacyListener() { return new LegacyConfigFileApplicationListener(this.logFactory.getLog(ConfigFileApplicationListener.class)); } @@ -200,6 +201,7 @@ public class ConfigDataEnvironmentPostProcessor implements EnvironmentPostProces postProcessor.postProcessEnvironment(environment, resourceLoader, additionalProfiles); } + @SuppressWarnings("deprecation") static class LegacyConfigFileApplicationListener extends ConfigFileApplicationListener { LegacyConfigFileApplicationListener(Log logger) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorTests.java index 8afd11dbbc..585e0dd84a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorTests.java @@ -71,6 +71,7 @@ class ConfigDataEnvironmentPostProcessorTests { private ArgumentCaptor resourceLoaderCaptor; @Test + @Deprecated void defaultOrderMatchesDeprecatedListener() { assertThat(ConfigDataEnvironmentPostProcessor.ORDER).isEqualTo(ConfigFileApplicationListener.DEFAULT_ORDER); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java index 69743d919b..9040a27782 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java @@ -72,6 +72,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; * @author Scott Frederick * @author Nguyen Bao Sach */ +@Deprecated @ExtendWith({ OutputCaptureExtension.class, UseLegacyProcessing.class }) class ConfigFileApplicationListenerTests {