From 069059d41236c5ae4dbb1fc5e0909cab505b76e5 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Tue, 16 Apr 2019 11:07:17 +0400 Subject: [PATCH] Check the string version of the stub runner url fixes gh-1045 --- .../cloud/contract/stubrunner/ClasspathStubProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/ClasspathStubProvider.java b/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/ClasspathStubProvider.java index 1258ca1382..097f0766dc 100644 --- a/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/ClasspathStubProvider.java +++ b/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/ClasspathStubProvider.java @@ -38,6 +38,7 @@ import org.springframework.cloud.contract.stubrunner.spring.StubRunnerProperties import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.Resource; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.util.StringUtils; /** * Stub downloader that picks stubs and contracts from the provided resource. If @@ -206,7 +207,7 @@ public class ClasspathStubProvider implements StubDownloaderBuilder { private List repoRoot(StubRunnerOptions stubRunnerOptions, StubConfiguration configuration) { - if (stubRunnerOptions.getStubRepositoryRoot() != null) { + if (StringUtils.hasText(stubRunnerOptions.getStubRepositoryRootAsString())) { return Collections.singletonList( new RepoRoot(stubRunnerOptions.getStubRepositoryRootAsString())); }