Allow test property sources to override command line args
Refine `SpringBootContextLoader` logic so that inline test properties are always added above command line arguments. Closes gh-29404
This commit is contained in:
@@ -140,7 +140,7 @@ class SpringBootContextLoaderTests {
|
||||
List<String> names = environment.getPropertySources().stream().map(PropertySource::getName)
|
||||
.collect(Collectors.toList());
|
||||
String last = names.remove(names.size() - 1);
|
||||
assertThat(names).containsExactly("configurationProperties", "commandLineArgs", "Inlined Test Properties",
|
||||
assertThat(names).containsExactly("configurationProperties", "Inlined Test Properties", "commandLineArgs",
|
||||
"servletConfigInitParams", "servletContextInitParams", "systemProperties", "systemEnvironment",
|
||||
"random");
|
||||
assertThat(last).startsWith("Config resource");
|
||||
|
||||
Reference in New Issue
Block a user