Search in sources :

Example 6 with PatternMatchingJGitEnvironmentRepository

use of org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository in project spring-cloud-config by spring-cloud.

the class MultipleJGitEnvironmentApplicationPlaceholderRepositoryTests method createRepository.

private PatternMatchingJGitEnvironmentRepository createRepository(String name, String pattern, String uri) {
    PatternMatchingJGitEnvironmentRepository repo = new PatternMatchingJGitEnvironmentRepository();
    repo.setEnvironment(this.environment);
    repo.setName(name);
    repo.setPattern(new String[] { pattern });
    repo.setUri(uri);
    return repo;
}
Also used : PatternMatchingJGitEnvironmentRepository(org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository)

Example 7 with PatternMatchingJGitEnvironmentRepository

use of org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository in project spring-cloud-config by spring-cloud.

the class MultipleJGitEnvironmentProfilePlaceholderRepositoryTests method createRepository.

private PatternMatchingJGitEnvironmentRepository createRepository(String name, String pattern, String uri) {
    PatternMatchingJGitEnvironmentRepository repo = new PatternMatchingJGitEnvironmentRepository();
    repo.setEnvironment(this.environment);
    repo.setName(name);
    repo.setPattern(new String[] { pattern });
    repo.setUri(uri);
    repo.setBasedir(new File("target/repos/pattern_repos", name));
    return repo;
}
Also used : File(java.io.File) PatternMatchingJGitEnvironmentRepository(org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository)

Example 8 with PatternMatchingJGitEnvironmentRepository

use of org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository in project spring-cloud-config by spring-cloud.

the class MultipleJGitEnvironmentRepositoryTests method createRepositories.

private Map<String, PatternMatchingJGitEnvironmentRepository> createRepositories() throws Exception {
    String test1Uri = ConfigServerTestUtils.prepareLocalRepo("test1-config-repo");
    Map<String, PatternMatchingJGitEnvironmentRepository> repos = new HashMap<>();
    repos.put("test1", createRepository("test1", "*test1*", test1Uri));
    return repos;
}
Also used : HashMap(java.util.HashMap) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) PatternMatchingJGitEnvironmentRepository(org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository)

Example 9 with PatternMatchingJGitEnvironmentRepository

use of org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository in project spring-cloud-config by spring-cloud.

the class MultipleJGitEnvironmentRepositoryTests method createRepository.

private PatternMatchingJGitEnvironmentRepository createRepository(String name, String pattern, String uri) {
    PatternMatchingJGitEnvironmentRepository repo = new PatternMatchingJGitEnvironmentRepository();
    repo.setEnvironment(this.environment);
    repo.setName(name);
    repo.setPattern(new String[] { pattern });
    repo.setUri(uri);
    repo.setBasedir(new File(this.repository.getBasedir().getParentFile(), name));
    return repo;
}
Also used : File(java.io.File) PatternMatchingJGitEnvironmentRepository(org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository)

Aggregations

PatternMatchingJGitEnvironmentRepository (org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository)9 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)5 HashMap (java.util.HashMap)3 File (java.io.File)2 TransportConfigCallback (org.eclipse.jgit.api.TransportConfigCallback)1 Test (org.junit.Test)1