From 837e8960c23a7d8e0e5f1f08374fbcab39452b3f Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 8 Aug 2023 11:39:52 +0300 Subject: [PATCH] Make addPropertySourcesToEnvironment() public This commit makes the recently introduced addPropertySourcesToEnvironment(ConfigurableEnvironment, ResourceLoader, List) method in TestPropertySourceUtils public so that it can be used by third parties (for example, Spring Boot). Closes gh-30981 --- .../test/context/support/TestPropertySourceUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spring-test/src/main/java/org/springframework/test/context/support/TestPropertySourceUtils.java b/spring-test/src/main/java/org/springframework/test/context/support/TestPropertySourceUtils.java index 66bd06f529..9050c22ee1 100644 --- a/spring-test/src/main/java/org/springframework/test/context/support/TestPropertySourceUtils.java +++ b/spring-test/src/main/java/org/springframework/test/context/support/TestPropertySourceUtils.java @@ -245,8 +245,10 @@ public abstract class TestPropertySourceUtils { * descriptors and registering property sources * @since 6.1 * @see TestPropertySource#locations + * @see TestPropertySource#encoding * @see TestPropertySource#factory * @see PropertySourceFactory + * @see #addPropertySourcesToEnvironment(ConfigurableEnvironment, ResourceLoader, List) */ public static void addPropertySourcesToEnvironment(ConfigurableApplicationContext context, List descriptors) { @@ -276,10 +278,11 @@ public abstract class TestPropertySourceUtils { * descriptors and registering property sources * @since 6.1 * @see TestPropertySource#locations + * @see TestPropertySource#encoding * @see TestPropertySource#factory * @see PropertySourceFactory */ - private static void addPropertySourcesToEnvironment(ConfigurableEnvironment environment, + public static void addPropertySourcesToEnvironment(ConfigurableEnvironment environment, ResourceLoader resourceLoader, List descriptors) { Assert.notNull(environment, "'environment' must not be null");