Skip to content

Commit 1c3ace7

Browse files
committed
Merge branch '2.4.x'
2 parents 82791b4 + e083be7 commit 1c3ace7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorIntegrationTests.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.io.IOException;
2222
import java.io.OutputStream;
2323
import java.util.ArrayList;
24+
import java.util.Arrays;
2425
import java.util.Collections;
2526
import java.util.HashMap;
2627
import java.util.List;
@@ -29,6 +30,7 @@
2930
import java.util.stream.Collectors;
3031
import java.util.stream.StreamSupport;
3132

33+
import org.apache.logging.log4j.util.Strings;
3234
import org.assertj.core.api.Condition;
3335
import org.junit.jupiter.api.AfterEach;
3436
import org.junit.jupiter.api.BeforeEach;
@@ -413,18 +415,18 @@ void loadWhenHasWhitespaceTrims() {
413415
void loadWhenHasConfigLocationAsFile() {
414416
String location = "file:src/test/resources/specificlocation.properties";
415417
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 + "'"));
419421
}
420422

421423
@Test
422424
void loadWhenHasRelativeConfigLocationUsesFileLocation() {
423425
String location = "src/test/resources/specificlocation.properties";
424426
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 + "'"));
428430
}
429431

430432
@Test

0 commit comments

Comments
 (0)