use of org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository in project spring-cloud-config by spring-cloud.
the class MultipleJGitEnvironmentApplicationPlaceholderRepositoryTests method getUri.
private String getUri(String pattern) {
String uri = null;
Map<String, PatternMatchingJGitEnvironmentRepository> repoMappings = this.repository.getRepos();
for (PatternMatchingJGitEnvironmentRepository repo : repoMappings.values()) {
String[] mappingPattern = repo.getPattern();
if (mappingPattern != null && mappingPattern.length != 0) {
uri = repo.getUri();
break;
}
}
return uri;
}
use of org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository in project spring-cloud-config by spring-cloud.
the class MultipleJGitEnvironmentProfilePlaceholderRepositoryTests method getUri.
private String getUri(String pattern) {
String uri = null;
Map<String, PatternMatchingJGitEnvironmentRepository> repoMappings = this.repository.getRepos();
for (PatternMatchingJGitEnvironmentRepository repo : repoMappings.values()) {
String[] mappingPattern = repo.getPattern();
if (mappingPattern != null && mappingPattern.length != 0) {
uri = repo.getUri();
break;
}
}
return uri;
}
use of org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository in project spring-cloud-config by spring-cloud.
the class MultipleJGitEnvironmentProfilePlaceholderRepositoryTests method createRepositories.
private Map<String, PatternMatchingJGitEnvironmentRepository> createRepositories() throws Exception {
String test1Uri = ConfigServerTestUtils.prepareLocalRepo("test1-config-repo");
ConfigServerTestUtils.prepareLocalRepo("test2-config-repo");
Map<String, PatternMatchingJGitEnvironmentRepository> repos = new HashMap<>();
repos.put("templates", createRepository("test", "*-config-repo", test1Uri.replace("test1-config-repo", "{profile}")));
return repos;
}
use of org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository in project spring-cloud-config by spring-cloud.
the class MultipleJGitEnvironmentRepositoryTests method getUri.
private String getUri(String pattern) {
String uri = null;
Map<String, PatternMatchingJGitEnvironmentRepository> repoMappings = this.repository.getRepos();
for (PatternMatchingJGitEnvironmentRepository repo : repoMappings.values()) {
String[] mappingPattern = repo.getPattern();
if (mappingPattern != null && mappingPattern.length != 0) {
uri = repo.getUri();
break;
}
}
return uri;
}
use of org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository in project spring-cloud-config by spring-cloud.
the class MultipleJGitEnvironmentRepositoryTests method shouldSetTransportConfigCallback.
@Test
public void shouldSetTransportConfigCallback() throws Exception {
TransportConfigCallback mockCallback1 = mock(TransportConfigCallback.class);
TransportConfigCallback mockCallback2 = mock(TransportConfigCallback.class);
PatternMatchingJGitEnvironmentRepository repo1 = createRepository("test1", "*test1*", "test1Uri");
PatternMatchingJGitEnvironmentRepository repo2 = createRepository("test2", "*test2*", "test2Uri");
repo2.setTransportConfigCallback(mockCallback2);
Map<String, PatternMatchingJGitEnvironmentRepository> repos = new HashMap<>();
repos.put("test1", repo1);
repos.put("test2", repo2);
this.repository.setRepos(repos);
this.repository.setTransportConfigCallback(mockCallback1);
this.repository.afterPropertiesSet();
assertEquals(repo1.getTransportConfigCallback(), mockCallback1);
assertEquals(repo2.getTransportConfigCallback(), mockCallback2);
}
Aggregations