|
|
|
|
@ -26,6 +26,7 @@ import java.util.stream.Stream;
@@ -26,6 +26,7 @@ import java.util.stream.Stream;
|
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
|
|
|
|
import org.springframework.boot.cloud.CloudPlatform; |
|
|
|
|
import org.springframework.boot.context.config.ConfigData.Option; |
|
|
|
|
import org.springframework.boot.context.config.ConfigDataEnvironmentContributor.ImportPhase; |
|
|
|
|
import org.springframework.boot.context.config.ConfigDataEnvironmentContributor.Kind; |
|
|
|
|
import org.springframework.boot.context.properties.bind.Binder; |
|
|
|
|
@ -334,6 +335,17 @@ class ConfigDataEnvironmentContributorTests {
@@ -334,6 +335,17 @@ class ConfigDataEnvironmentContributorTests {
|
|
|
|
|
() -> createBoundContributor(null, new ConfigData(Collections.singleton(propertySource)), 0)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test // gh-25029
|
|
|
|
|
void withBoundPropertiesWhenIgnoringImportsAndNothingBound() { |
|
|
|
|
TestResource resource = new TestResource("a"); |
|
|
|
|
ConfigData configData = new ConfigData(Collections.singleton(new MockPropertySource()), Option.IGNORE_IMPORTS); |
|
|
|
|
ConfigDataEnvironmentContributor contributor = ConfigDataEnvironmentContributor.ofUnboundImport(TEST_LOCATION, |
|
|
|
|
resource, false, configData, 0); |
|
|
|
|
Binder binder = new Binder(contributor.getConfigurationPropertySource()); |
|
|
|
|
ConfigDataEnvironmentContributor bound = contributor.withBoundProperties(binder); |
|
|
|
|
assertThat(bound).isNotNull(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private ConfigDataEnvironmentContributor createBoundContributor(String location) { |
|
|
|
|
return createBoundContributor(new TestResource(location), |
|
|
|
|
new ConfigData(Collections.singleton(new MockPropertySource())), 0); |
|
|
|
|
|