Skip to content

Commit f855256

Browse files
committed
Merge branch '2.4.x'
2 parents 4040105 + a2d0b64 commit f855256

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import java.io.File;
2020
import java.io.FileOutputStream;
21+
import java.io.IOException;
2122
import java.io.OutputStream;
2223
import java.util.ArrayList;
2324
import java.util.Collections;
@@ -56,6 +57,7 @@
5657
import org.springframework.core.io.ClassPathResource;
5758
import org.springframework.core.io.Resource;
5859
import org.springframework.core.io.ResourceLoader;
60+
import org.springframework.util.FileCopyUtils;
5961
import org.springframework.util.StringUtils;
6062

6163
import static org.assertj.core.api.Assertions.assertThat;
@@ -544,6 +546,15 @@ void runWhenConfigLocationHasNonOptionalEmptyFileDirectoryDoesNotThrowException(
544546
.run("--spring.config.location=" + StringUtils.cleanPath(location.getAbsolutePath()) + "/"));
545547
}
546548

549+
@Test
550+
void runWhenConfigLocationHasNonOptionalEmptyFileDoesNotThrowException() throws IOException {
551+
File location = new File(this.temp, "application.properties");
552+
FileCopyUtils.copy(new byte[0], location);
553+
assertThatNoException()
554+
.isThrownBy(() -> this.application.run("--spring.config.location=classpath:/application.properties,"
555+
+ StringUtils.cleanPath(location.getAbsolutePath())));
556+
}
557+
547558
@Test
548559
@Disabled("Disabled until spring.profiles suppport is dropped")
549560
void runWhenUsingInvalidPropertyThrowsException() {

0 commit comments

Comments
 (0)