added unit test for svn label fix
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package org.springframework.cloud.config.server.environment;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
@@ -143,6 +144,20 @@ public class SVNKitEnvironmentRepositoryIntegrationTests {
|
||||
assertEquals(0, environment.getPropertySources().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void branchLabel() throws Exception {
|
||||
String uri = ConfigServerTestUtils.prepareLocalSvnRepo(
|
||||
"src/test/resources/svn-config-repo", "target/config");
|
||||
this.context = new SpringApplicationBuilder(TestConfiguration.class).web(false)
|
||||
.profiles("subversion")
|
||||
.run("--spring.cloud.config.server.svn.uri=" + uri);
|
||||
EnvironmentRepository repository = this.context.getBean(EnvironmentRepository.class);
|
||||
Environment environment = repository.findOne("bar", "staging", "demobranch");
|
||||
assertTrue(environment.getPropertySources().get(0).getName()
|
||||
.contains("bar.properties"));
|
||||
assertEquals(1, environment.getPropertySources().size());
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@Import({ PropertyPlaceholderAutoConfiguration.class, EnvironmentRepositoryConfiguration.class })
|
||||
protected static class TestConfiguration {
|
||||
|
||||
@@ -103,6 +103,15 @@ public class SVNKitEnvironmentRepositoryTests {
|
||||
.contains("bar.properties"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void branch_no_folder() {
|
||||
Environment environment = this.repository.findOne("bar", "staging",
|
||||
"demobranch");
|
||||
assertEquals(1, environment.getPropertySources().size());
|
||||
assertTrue(environment.getPropertySources().get(0).getName()
|
||||
.contains("bar.properties"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void vanilla_with_update() {
|
||||
this.findOne();
|
||||
|
||||
Reference in New Issue
Block a user