|
21 | 21 | import java.io.IOException; |
22 | 22 | import java.io.OutputStream; |
23 | 23 | import java.util.ArrayList; |
| 24 | +import java.util.Arrays; |
24 | 25 | import java.util.Collections; |
25 | 26 | import java.util.HashMap; |
26 | 27 | import java.util.List; |
|
29 | 30 | import java.util.stream.Collectors; |
30 | 31 | import java.util.stream.StreamSupport; |
31 | 32 |
|
| 33 | +import org.apache.logging.log4j.util.Strings; |
32 | 34 | import org.assertj.core.api.Condition; |
33 | 35 | import org.junit.jupiter.api.AfterEach; |
34 | 36 | import org.junit.jupiter.api.BeforeEach; |
@@ -413,18 +415,18 @@ void loadWhenHasWhitespaceTrims() { |
413 | 415 | void loadWhenHasConfigLocationAsFile() { |
414 | 416 | String location = "file:src/test/resources/specificlocation.properties"; |
415 | 417 | ConfigurableApplicationContext context = this.application.run("--spring.config.location=" + location); |
416 | | - assertThat(context.getEnvironment()).has(matchingPropertySource( |
417 | | - "Config resource 'file [src/test/resources/specificlocation.properties]' via location '" + location |
418 | | - + "'")); |
| 418 | + assertThat(context.getEnvironment()).has(matchingPropertySource("Config resource 'file [" + Strings |
| 419 | + .join(Arrays.asList("src", "test", "resources", "specificlocation.properties"), File.separatorChar) |
| 420 | + + "]' via location '" + location + "'")); |
419 | 421 | } |
420 | 422 |
|
421 | 423 | @Test |
422 | 424 | void loadWhenHasRelativeConfigLocationUsesFileLocation() { |
423 | 425 | String location = "src/test/resources/specificlocation.properties"; |
424 | 426 | ConfigurableApplicationContext context = this.application.run("--spring.config.location=" + location); |
425 | | - assertThat(context.getEnvironment()).has(matchingPropertySource( |
426 | | - "Config resource 'file [src/test/resources/specificlocation.properties]' via location '" + location |
427 | | - + "'")); |
| 427 | + assertThat(context.getEnvironment()).has(matchingPropertySource("Config resource 'file [" + Strings |
| 428 | + .join(Arrays.asList("src", "test", "resources", "specificlocation.properties"), File.separatorChar) |
| 429 | + + "]' via location '" + location + "'")); |
428 | 430 | } |
429 | 431 |
|
430 | 432 | @Test |
|
0 commit comments