use of org.springframework.cloud.config.environment.Environment in project spring-cloud-config by spring-cloud.
the class JGitEnvironmentRepositoryTests method placeholderInSearchPath.
@Test
public void placeholderInSearchPath() throws IOException {
String uri = ConfigServerTestUtils.prepareLocalRepo("another-config-repo");
this.repository.setUri(uri);
this.repository.setSearchPaths(new String[] { "{application}" });
this.repository.findOne("sub", "staging", "master");
Environment environment = this.repository.findOne("sub", "staging", "master");
assertEquals(1, environment.getPropertySources().size());
assertEquals(this.repository.getUri() + "/sub/application.yml", 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 JGitEnvironmentRepositoryTests method branch.
@Test
public void branch() {
this.repository.setBasedir(this.basedir);
Environment environment = this.repository.findOne("bar", "staging", "raw");
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 JGitEnvironmentRepositoryTests method vanilla.
@Test
public void vanilla() {
this.repository.findOne("bar", "staging", "master");
Environment environment = this.repository.findOne("bar", "staging", "master");
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 MultipleJGitEnvironmentApplicationPlaceholderRepositoryTests method mappingRepo.
@Test
public void mappingRepo() {
Environment environment = this.repository.findOne("test1-config-repo", "staging", "master");
assertEquals(1, environment.getPropertySources().size());
assertEquals(getUri("*").replace("{application}", "test1-config-repo") + "/application.yml", 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 MultipleJGitEnvironmentApplicationPlaceholderRepositoryTests method missingRepo.
@Test
public void missingRepo() {
Environment environment = this.repository.findOne("missing-config-repo", "staging", "master");
assertEquals("Wrong property sources: " + environment, 1, environment.getPropertySources().size());
assertEquals(this.repository.getUri() + "/application.yml", environment.getPropertySources().get(0).getName());
assertVersion(environment);
}
Aggregations