Polish restoration of ConfigFileApplicationListener

See gh-27303
This commit is contained in:
Andy Wilkinson 2021-07-14 18:01:34 +01:00
parent b39ed7f086
commit 8540bc0d12
3 changed files with 4 additions and 0 deletions

View File

@ -129,6 +129,7 @@ public class ConfigDataEnvironmentPostProcessor implements EnvironmentPostProces
getLegacyListener().addPropertySources(environment, resourceLoader); getLegacyListener().addPropertySources(environment, resourceLoader);
} }
@SuppressWarnings("deprecation")
LegacyConfigFileApplicationListener getLegacyListener() { LegacyConfigFileApplicationListener getLegacyListener() {
return new LegacyConfigFileApplicationListener(this.logFactory.getLog(ConfigFileApplicationListener.class)); return new LegacyConfigFileApplicationListener(this.logFactory.getLog(ConfigFileApplicationListener.class));
} }
@ -200,6 +201,7 @@ public class ConfigDataEnvironmentPostProcessor implements EnvironmentPostProces
postProcessor.postProcessEnvironment(environment, resourceLoader, additionalProfiles); postProcessor.postProcessEnvironment(environment, resourceLoader, additionalProfiles);
} }
@SuppressWarnings("deprecation")
static class LegacyConfigFileApplicationListener extends ConfigFileApplicationListener { static class LegacyConfigFileApplicationListener extends ConfigFileApplicationListener {
LegacyConfigFileApplicationListener(Log logger) { LegacyConfigFileApplicationListener(Log logger) {

View File

@ -71,6 +71,7 @@ class ConfigDataEnvironmentPostProcessorTests {
private ArgumentCaptor<ResourceLoader> resourceLoaderCaptor; private ArgumentCaptor<ResourceLoader> resourceLoaderCaptor;
@Test @Test
@Deprecated
void defaultOrderMatchesDeprecatedListener() { void defaultOrderMatchesDeprecatedListener() {
assertThat(ConfigDataEnvironmentPostProcessor.ORDER).isEqualTo(ConfigFileApplicationListener.DEFAULT_ORDER); assertThat(ConfigDataEnvironmentPostProcessor.ORDER).isEqualTo(ConfigFileApplicationListener.DEFAULT_ORDER);
} }

View File

@ -72,6 +72,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
* @author Scott Frederick * @author Scott Frederick
* @author Nguyen Bao Sach * @author Nguyen Bao Sach
*/ */
@Deprecated
@ExtendWith({ OutputCaptureExtension.class, UseLegacyProcessing.class }) @ExtendWith({ OutputCaptureExtension.class, UseLegacyProcessing.class })
class ConfigFileApplicationListenerTests { class ConfigFileApplicationListenerTests {