Trying to fix the build

This commit is contained in:
Marcin Grzejszczak
2018-03-31 17:29:47 +02:00
parent 0fe31ce3a5
commit c36c630412
2 changed files with 14 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ public class ContractProjectUpdaterTest extends AbstractGitTest {
this.gitRepo = new GitRepo(this.tmpFolder);
this.origin = clonedProject(this.tmp.newFolder(), this.originalProject);
this.project = this.gitRepo.cloneProject(this.originalProject.toURI());
this.gitRepo.checkout(this.project, "master");
setOriginOnProjectToTmp(this.origin, this.project, true);
StubRunnerOptions options = new StubRunnerOptionsBuilder()
.withStubRepositoryRoot("file://" + this.project.getAbsolutePath() + "/")

View File

@@ -17,6 +17,7 @@ package org.springframework.cloud.contract.stubrunner;
import java.io.File;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
import org.junit.Before;
@@ -46,6 +47,7 @@ public class GitStubDownloaderTests {
StubDownloader stubDownloader = stubDownloaderBuilder.build(new StubRunnerOptionsBuilder()
.withStubsMode(StubRunnerProperties.StubsMode.CLASSPATH)
.withProperties(props())
.build());
then(stubDownloader).isNull();
@@ -57,6 +59,7 @@ public class GitStubDownloaderTests {
StubDownloader stubDownloader = stubDownloaderBuilder.build(new StubRunnerOptionsBuilder()
.withStubsMode(StubRunnerProperties.StubsMode.REMOTE)
.withProperties(props())
.build());
then(stubDownloader).isNull();
@@ -69,6 +72,7 @@ public class GitStubDownloaderTests {
StubDownloader stubDownloader = stubDownloaderBuilder.build(new StubRunnerOptionsBuilder()
.withStubsMode(StubRunnerProperties.StubsMode.REMOTE)
.withStubRepositoryRoot("http://foo.com")
.withProperties(props())
.build());
then(stubDownloader).isNull();
@@ -80,6 +84,7 @@ public class GitStubDownloaderTests {
StubDownloader stubDownloader = stubDownloaderBuilder.build(new StubRunnerOptionsBuilder()
.withStubsMode(StubRunnerProperties.StubsMode.REMOTE)
.withStubRepositoryRoot("git://" + file("/git_samples/contract-git/").getAbsolutePath() + "/")
.withProperties(props())
.build());
Map.Entry<StubConfiguration, File> entry = stubDownloader
@@ -96,6 +101,7 @@ public class GitStubDownloaderTests {
StubDownloader stubDownloader = stubDownloaderBuilder.build(new StubRunnerOptionsBuilder()
.withStubsMode(StubRunnerProperties.StubsMode.REMOTE)
.withStubRepositoryRoot("git://" + file("/git_samples/contract-git").getAbsolutePath())
.withProperties(props())
.build());
try {
@@ -113,6 +119,7 @@ public class GitStubDownloaderTests {
StubDownloader stubDownloader = stubDownloaderBuilder.build(new StubRunnerOptionsBuilder()
.withStubsMode(StubRunnerProperties.StubsMode.REMOTE)
.withStubRepositoryRoot("git://" + file("/git_samples/contract-git").getAbsolutePath())
.withProperties(props())
.build());
try {
@@ -123,6 +130,12 @@ public class GitStubDownloaderTests {
}
}
private Map<String, String> props() {
Map<String, String> map = new HashMap<>();
map.put("git.branch", "master");
return map;
}
private File file(String relativePath) throws URISyntaxException {
return new File(GitStubDownloaderTests.class.getResource(relativePath).toURI());
}