Skip to content

Commit 837e896

Browse files
committed
Make addPropertySourcesToEnvironment() public
This commit makes the recently introduced addPropertySourcesToEnvironment(ConfigurableEnvironment, ResourceLoader, List<PropertySourceDescriptor>) method in TestPropertySourceUtils public so that it can be used by third parties (for example, Spring Boot). Closes gh-30981
1 parent 8a6c52b commit 837e896

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spring-test/src/main/java/org/springframework/test/context/support/TestPropertySourceUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,10 @@ public static void addPropertiesFilesToEnvironment(ConfigurableEnvironment envir
245245
* descriptors and registering property sources
246246
* @since 6.1
247247
* @see TestPropertySource#locations
248+
* @see TestPropertySource#encoding
248249
* @see TestPropertySource#factory
249250
* @see PropertySourceFactory
251+
* @see #addPropertySourcesToEnvironment(ConfigurableEnvironment, ResourceLoader, List)
250252
*/
251253
public static void addPropertySourcesToEnvironment(ConfigurableApplicationContext context,
252254
List<PropertySourceDescriptor> descriptors) {
@@ -276,10 +278,11 @@ public static void addPropertySourcesToEnvironment(ConfigurableApplicationContex
276278
* descriptors and registering property sources
277279
* @since 6.1
278280
* @see TestPropertySource#locations
281+
* @see TestPropertySource#encoding
279282
* @see TestPropertySource#factory
280283
* @see PropertySourceFactory
281284
*/
282-
private static void addPropertySourcesToEnvironment(ConfigurableEnvironment environment,
285+
public static void addPropertySourcesToEnvironment(ConfigurableEnvironment environment,
283286
ResourceLoader resourceLoader, List<PropertySourceDescriptor> descriptors) {
284287

285288
Assert.notNull(environment, "'environment' must not be null");

0 commit comments

Comments
 (0)