|
|
|
|
@@ -69,7 +69,8 @@ class ConfigServerConfigDataLoaderTests {
|
|
|
|
|
|
|
|
|
|
@Disabled
|
|
|
|
|
@Test
|
|
|
|
|
// TODO Enable once we have https://github.com/spring-cloud/spring-cloud-config/issues/2291
|
|
|
|
|
// TODO Enable once we have
|
|
|
|
|
// https://github.com/spring-cloud/spring-cloud-config/issues/2291
|
|
|
|
|
void filterPropertySourcesThatAreNotProfileSpecific() {
|
|
|
|
|
PropertySource p1 = new PropertySource("p1", Collections.singletonMap("foo", "bar"));
|
|
|
|
|
PropertySource p2 = new PropertySource("p2", Collections.singletonMap("hello", "world"));
|
|
|
|
|
@@ -80,7 +81,8 @@ class ConfigServerConfigDataLoaderTests {
|
|
|
|
|
|
|
|
|
|
@Disabled
|
|
|
|
|
@Test
|
|
|
|
|
// TODO Enable once we have https://github.com/spring-cloud/spring-cloud-config/issues/2291
|
|
|
|
|
// TODO Enable once we have
|
|
|
|
|
// https://github.com/spring-cloud/spring-cloud-config/issues/2291
|
|
|
|
|
void returnPropertySourcesThatAreProfileSpecific() {
|
|
|
|
|
PropertySource p1 = new PropertySource("p1-dev", Collections.singletonMap("foo", "bar"));
|
|
|
|
|
PropertySource p2 = new PropertySource("p2-dev", Collections.singletonMap("hello", "world"));
|
|
|
|
|
@@ -96,42 +98,43 @@ class ConfigServerConfigDataLoaderTests {
|
|
|
|
|
|
|
|
|
|
@Disabled
|
|
|
|
|
@Test
|
|
|
|
|
// TODO Enable once we have https://github.com/spring-cloud/spring-cloud-config/issues/2291
|
|
|
|
|
// TODO Enable once we have
|
|
|
|
|
// https://github.com/spring-cloud/spring-cloud-config/issues/2291
|
|
|
|
|
void filterPropertySourcesWithDocuments() {
|
|
|
|
|
PropertySource p1 = new PropertySource(
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/application.yml",
|
|
|
|
|
Collections.singletonMap("foo", "bar"));
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/application.yml",
|
|
|
|
|
Collections.singletonMap("foo", "bar"));
|
|
|
|
|
PropertySource p2 = new PropertySource(
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/application-foo.yml",
|
|
|
|
|
Collections.singletonMap("foo", "bar"));
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/application-foo.yml",
|
|
|
|
|
Collections.singletonMap("foo", "bar"));
|
|
|
|
|
PropertySource p3 = new PropertySource(
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/Config resource 'file [/var/folders/k3/zv8hzdm17vv69j485fv3cf9r0000gp/T/config-repo-14772121892716396795/commons/application.properties' via location 'commons/' (document #0)",
|
|
|
|
|
Collections.singletonMap("hello", "world"));
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/Config resource 'file [/var/folders/k3/zv8hzdm17vv69j485fv3cf9r0000gp/T/config-repo-14772121892716396795/commons/application.properties' via location 'commons/' (document #0)",
|
|
|
|
|
Collections.singletonMap("hello", "world"));
|
|
|
|
|
PropertySource p4 = new PropertySource(
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/Config resource 'file [/var/folders/k3/zv8hzdm17vv69j485fv3cf9r0000gp/T/config-repo-14772121892716396795/commons/application-foo.properties' via location 'commons/' (document #0)",
|
|
|
|
|
Collections.singletonMap("hello", "world"));
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/Config resource 'file [/var/folders/k3/zv8hzdm17vv69j485fv3cf9r0000gp/T/config-repo-14772121892716396795/commons/application-foo.properties' via location 'commons/' (document #0)",
|
|
|
|
|
Collections.singletonMap("hello", "world"));
|
|
|
|
|
Map<String, Object> activatesOnProfileCamelCase = new HashMap<>();
|
|
|
|
|
activatesOnProfileCamelCase.put("spring.config.activate.onProfile", "foo");
|
|
|
|
|
PropertySource p5 = new PropertySource(
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/Config resource 'file [/var/folders/k3/zv8hzdm17vv69j485fv3cf9r0000gp/T/config-repo-14772121892716396795/commons/application.properties' via location 'commons/' (document #1)",
|
|
|
|
|
activatesOnProfileCamelCase);
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/Config resource 'file [/var/folders/k3/zv8hzdm17vv69j485fv3cf9r0000gp/T/config-repo-14772121892716396795/commons/application.properties' via location 'commons/' (document #1)",
|
|
|
|
|
activatesOnProfileCamelCase);
|
|
|
|
|
Map<String, Object> activatesOnProfile = new HashMap<>();
|
|
|
|
|
activatesOnProfile.put("spring.config.activate.on-profile", "foo");
|
|
|
|
|
PropertySource p6 = new PropertySource(
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/Config resource 'file [/var/folders/k3/zv8hzdm17vv69j485fv3cf9r0000gp/T/config-repo-14772121892716396795/commons/application.properties' via location 'commons/' (document #2)",
|
|
|
|
|
activatesOnProfile);
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/Config resource 'file [/var/folders/k3/zv8hzdm17vv69j485fv3cf9r0000gp/T/config-repo-14772121892716396795/commons/application.properties' via location 'commons/' (document #2)",
|
|
|
|
|
activatesOnProfile);
|
|
|
|
|
PropertySource p7 = new PropertySource(
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/application-foo.yaml",
|
|
|
|
|
Collections.singletonMap("hello", "world"));
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/application-foo.yaml",
|
|
|
|
|
Collections.singletonMap("hello", "world"));
|
|
|
|
|
PropertySource p8 = new PropertySource(
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/Config resource 'file [/var/folders/k3/zv8hzdm17vv69j485fv3cf9r0000gp/T/config-repo-14772121892716396795/commons/application-foo.yaml' via location 'commons/' (document #0)",
|
|
|
|
|
Collections.singletonMap("hello", "world"));
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/Config resource 'file [/var/folders/k3/zv8hzdm17vv69j485fv3cf9r0000gp/T/config-repo-14772121892716396795/commons/application-foo.yaml' via location 'commons/' (document #0)",
|
|
|
|
|
Collections.singletonMap("hello", "world"));
|
|
|
|
|
PropertySource p9 = new PropertySource(
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/Config resource 'file [/var/folders/k3/zv8hzdm17vv69j485fv3cf9r0000gp/T/config-repo-14772121892716396795/commons/application-foo.yaml' via location 'commons/' (document #1)",
|
|
|
|
|
Collections.singletonMap("hello", "world"));
|
|
|
|
|
"configserver:git@github.com:demo/support-configuration-repo.git/Config resource 'file [/var/folders/k3/zv8hzdm17vv69j485fv3cf9r0000gp/T/config-repo-14772121892716396795/commons/application-foo.yaml' via location 'commons/' (document #1)",
|
|
|
|
|
Collections.singletonMap("hello", "world"));
|
|
|
|
|
|
|
|
|
|
ConfigData configData = setupConfigServerConfigDataLoader(Arrays.asList(p1, p2, p3, p4, p5, p6, p7, p8, p9),
|
|
|
|
|
"application-slash", "foo");
|
|
|
|
|
"application-slash", "foo");
|
|
|
|
|
assertThat(configData.getPropertySources().size()).isEqualTo(7);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|