Test optional directories without sub-directories

Add an additional test to ensure that optional wildcard
directory patterns do not fail.

See gh-26677
pull/26691/head
Phillip Webb 4 years ago
parent 38b9a833bd
commit 3f858ed8a4

@ -719,6 +719,12 @@ class ConfigDataEnvironmentPostProcessorIntegrationTests {
"Config data location 'file:src/test/resources/config/0-empty/*/' contains no subdirectories");
}
@Test
void runWhenOptionalWildcardLocationHasNoSubdirectories() {
assertThatNoException().isThrownBy(() -> this.application
.run("--spring.config.location=optional:file:src/test/resources/config/0-empty/*/"));
}
@Test
void runWhenHasMandatoryWildcardLocationThatDoesNotExist() {
assertThatExceptionOfType(ConfigDataLocationNotFoundException.class)

Loading…
Cancel
Save