Fail if no configserver config import.

Adds ConfigServerConfigDataMissingEnvironmentPostProcessor that checks if there is a spring.config.import=configserver: statement. If not, an exception is thrown and a FailureAnalyzer provides hints to fix the issue.

Fixes gh-1813
This commit is contained in:
spencergibb
2021-03-10 16:59:21 -05:00
parent d832ed5a22
commit 2ea5e11c9a
7 changed files with 198 additions and 4 deletions

View File

@@ -56,8 +56,8 @@ import static org.springframework.cloud.config.server.test.ConfigServerTestUtils
import static org.springframework.cloud.config.server.test.ConfigServerTestUtils.getV2AcceptEntity;
@RunWith(SpringRunner.class)
@SpringBootTest(
classes = TestConfiguration.class, properties = { "spring.cloud.config.enabled=true",
@SpringBootTest(classes = TestConfiguration.class,
properties = { "spring.cloud.config.enabled=true", "spring.cloud.bootstrap.enabled=true",
"management.endpoint.env.post.enabled=true", "management.endpoints.web.exposure.include=env, refresh" },
webEnvironment = WebEnvironment.RANDOM_PORT)
@ActiveProfiles("test")