Support for new ConfigDataLoader infrastructure. (#1656)

This allows for `spring.config.import=configserver:`

Supports the fact that bootstrap is now opt in. In config client, by default, `ConfigServerConfigData*` will be used instead of `ConfigServicePropertySourceLocator`.
This commit is contained in:
Spencer Gibb
2020-08-06 15:55:07 -04:00
committed by GitHub
parent 43a13dd899
commit 854060b019
23 changed files with 919 additions and 65 deletions

View File

@@ -52,6 +52,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
// config
// server on the classpath we need to set it explicitly
properties = { "spring.cloud.config.enabled:true", "",
"spring.config.use-legacy-processing=true",
"management.security.enabled=false",
"management.endpoints.web.exposure.include=*" },
webEnvironment = RANDOM_PORT)
@@ -76,6 +77,8 @@ public class ApplicationBootstrapTests {
System.setProperty("repo1", repo);
server = SpringApplication.run(
org.springframework.cloud.config.server.ConfigServerApplication.class,
// FIXME: configdata why is use legacy needed here and above?
"--spring.config.use-legacy-processing=true",
"--server.port=" + configPort, "--spring.config.name=compositeserver",
"--repo1=" + repo);
System.setProperty("config.port", "" + configPort);

View File

@@ -25,11 +25,13 @@ import static org.assertj.core.api.Assertions.fail;
public class ApplicationFailFastTests {
// FIXME: configdata failfast works.
@Test
public void contextFails() {
try {
new SpringApplicationBuilder().sources(Application.class).run(
"--server.port=0", "--spring.cloud.config.enabled=true",
"--spring.config.use-legacy-processing=true", "--server.port=0",
"--spring.cloud.config.enabled=true",
"--spring.cloud.config.fail-fast=true",
"--spring.cloud.config.uri=http://serverhostdoesnotexist:1234");
fail("failFast option did not produce an exception");

View File

@@ -43,6 +43,8 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
// config
// server on the classpath we need to set it explicitly
properties = { "spring.cloud.config.enabled:true",
// FIXME: configdata why is this needed here?
"spring.config.use-legacy-processing=true",
"management.security.enabled=false",
"management.endpoints.web.exposure.include=*" },
webEnvironment = RANDOM_PORT)