use of org.springframework.cloud.config.environment.Environment in project spring-cloud-config by spring-cloud.
the class MultipleJGitEnvironmentProfilePlaceholderRepositoryTests method otherMappingRepo.
@Test
public void otherMappingRepo() {
Environment environment = this.repository.findOne("application", "test2-config-repo", "master");
assertEquals(1, environment.getPropertySources().size());
assertEquals(getUri("*").replace("{profile}", "test2-config-repo") + "/application.properties", environment.getPropertySources().get(0).getName());
assertVersion(environment);
}
use of org.springframework.cloud.config.environment.Environment in project spring-cloud-config by spring-cloud.
the class MultipleJGitEnvironmentProfilePlaceholderRepositoryTests method twoMappingRepos.
@Test
public void twoMappingRepos() {
Environment environment = this.repository.findOne("application", "test1-config-repo,test2-config-repo,missing-config-repo", "master");
assertEquals(1, environment.getPropertySources().size());
assertEquals(getUri("*").replace("{profile}", "test2-config-repo") + "/application.properties", environment.getPropertySources().get(0).getName());
assertVersion(environment);
assertArrayEquals(environment.getProfiles(), new String[] { "test1-config-repo", "test2-config-repo", "missing-config-repo" });
}
use of org.springframework.cloud.config.environment.Environment in project spring-cloud-config by spring-cloud.
the class MultipleJGitEnvironmentRepositoryTests method defaultRepoTag.
@Test
public void defaultRepoTag() {
Environment environment = this.repository.findOne("bar", "staging", "foo");
assertEquals(2, environment.getPropertySources().size());
assertEquals(this.repository.getUri() + "/bar.properties", environment.getPropertySources().get(0).getName());
assertVersion(environment);
}
use of org.springframework.cloud.config.environment.Environment in project spring-cloud-config by spring-cloud.
the class MultipleJGitEnvironmentRepositoryTests method defaultLabel.
@Test
public void defaultLabel() {
this.repository.setDefaultLabel("raw");
Environment environment = this.repository.findOne("bar", "staging", null);
assertEquals("raw", environment.getLabel());
assertEquals(2, environment.getPropertySources().size());
assertEquals(this.repository.getUri() + "/bar.properties", environment.getPropertySources().get(0).getName());
assertVersion(environment);
}
use of org.springframework.cloud.config.environment.Environment in project spring-cloud-config by spring-cloud.
the class MultipleJGitEnvironmentRepositoryTests method mappingRepoWithDefaultLabel.
@Test
public void mappingRepoWithDefaultLabel() {
Environment environment = this.repository.findOne("test1-svc", "staging", null);
assertEquals("master", environment.getLabel());
assertEquals(2, environment.getPropertySources().size());
assertEquals(getUri("*test1*") + "/test1-svc.properties", environment.getPropertySources().get(0).getName());
assertVersion(environment);
}
Aggregations