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 a553f59ac0..a9fc1c90c9 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 @@ -21,6 +21,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. @@ -174,7 +175,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())); }