From d87e669a238b2992990b10f8cb2f52416e21449f Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Fri, 16 Feb 2018 13:35:56 +0100 Subject: [PATCH 1/3] Adding a mechanism to disable the local vs remote stub location When fetching stubs / contracts in a CI, shared environment, what might happen is that both the producer and the consumer reuse the same local Maven repository. Due to this, the framework, responsible for downloading a stub JAR from remote location, can't decide which JAR should be picked, local or remote one. That caused the `"The artifact was found in the local repository but you have explicitly stated that it should be downloaded from a remote one"` exception and failed the build. For such cases we're introducing the property mechanism: - via `stubrunner.snapshot-check.skip` system property - via `STUBRUNNER_SNAPSHOT_CHECK_SKIP` environment variable if either of these values is set to `true`, then the stub downloader will not verify the origin of the downloaded JAR. fixes gh-545 --- README.adoc | 16 +- docs/src/main/asciidoc/verifier_setup.adoc | 80 ++------ .../stubrunner/AetherStubDownloader.java | 14 +- .../stubrunner/StubRunnerOptions.java | 2 +- .../AetherStubDownloaderSpec.groovy | 174 +++++++++++------- 5 files changed, 147 insertions(+), 139 deletions(-) diff --git a/README.adoc b/README.adoc index cb8f560811..8115833f80 100644 --- a/README.adoc +++ b/README.adoc @@ -166,7 +166,7 @@ From the Consumer perspective, when shooting a request in the integration test: (2) - With the "PUT" method (3) - to the URL "/fraudcheck" (4) - with the JSON body that - * has a field `clientId` that matches a regular expression `[0-9]{10}` + * has a field `client.id` that matches a regular expression `[0-9]{10}` * has a field `loanAmount` that is equal to `99999` (5) - with header `Content-Type` equal to `application/json` (6) - then the response will be sent with @@ -181,7 +181,7 @@ From the Producer perspective, in the autogenerated producer-side test: (2) - With the "PUT" method (3) - to the URL "/fraudcheck" (4) - with the JSON body that - * has a field `clientId` that will have a generated value that matches a regular expression `[0-9]{10}` + * has a field `client.id` that will have a generated value that matches a regular expression `[0-9]{10}` * has a field `loanAmount` that is equal to `99999` (5) - with header `Content-Type` equal to `application/json` (6) - then the test will assert if the response has been sent with @@ -223,7 +223,7 @@ response: # (7) #(2) - With the "PUT" method #(3) - to the URL "/fraudcheck" #(4) - with the JSON body that -# * has a field `clientId` +# * has a field `client.id` # * has a field `loanAmount` that is equal to `99999` #(5) - with header `Content-Type` equal to `application/json` #(6) - and a `client.id` json entry matches the regular expression `[0-9]{10}` @@ -239,7 +239,7 @@ response: # (7) #(2) - With the "PUT" method #(3) - to the URL "/fraudcheck" #(4) - with the JSON body that -# * has a field `clientId` `1234567890` +# * has a field `client.id` `1234567890` # * has a field `loanAmount` that is equal to `99999` #(5) - with header `Content-Type` equal to `application/json` #(7) - then the test will assert if the response has been sent with @@ -523,7 +523,7 @@ From the Consumer perspective, when shooting a request in the integration test: (2) - With the "PUT" method (3) - to the URL "/fraudcheck" (4) - with the JSON body that - * has a field `clientId` that matches a regular expression `[0-9]{10}` + * has a field `client.id` that matches a regular expression `[0-9]{10}` * has a field `loanAmount` that is equal to `99999` (5) - with header `Content-Type` equal to `application/json` (6) - then the response will be sent with @@ -538,7 +538,7 @@ From the Producer perspective, in the autogenerated producer-side test: (2) - With the "PUT" method (3) - to the URL "/fraudcheck" (4) - with the JSON body that - * has a field `clientId` that will have a generated value that matches a regular expression `[0-9]{10}` + * has a field `client.id` that will have a generated value that matches a regular expression `[0-9]{10}` * has a field `loanAmount` that is equal to `99999` (5) - with header `Content-Type` equal to `application/json` (6) - then the test will assert if the response has been sent with @@ -580,7 +580,7 @@ response: # (7) #(2) - With the "PUT" method #(3) - to the URL "/fraudcheck" #(4) - with the JSON body that -# * has a field `clientId` +# * has a field `client.id` # * has a field `loanAmount` that is equal to `99999` #(5) - with header `Content-Type` equal to `application/json` #(6) - and a `client.id` json entry matches the regular expression `[0-9]{10}` @@ -596,7 +596,7 @@ response: # (7) #(2) - With the "PUT" method #(3) - to the URL "/fraudcheck" #(4) - with the JSON body that -# * has a field `clientId` `1234567890` +# * has a field `client.id` `1234567890` # * has a field `loanAmount` that is equal to `99999` #(5) - with header `Content-Type` equal to `application/json` #(7) - then the test will assert if the response has been sent with diff --git a/docs/src/main/asciidoc/verifier_setup.adoc b/docs/src/main/asciidoc/verifier_setup.adoc index a242a0a348..178e37fbe9 100644 --- a/docs/src/main/asciidoc/verifier_setup.adoc +++ b/docs/src/main/asciidoc/verifier_setup.adoc @@ -393,7 +393,6 @@ following sections: * <> * <> * <> -* <> [[maven-add-plugin]] ==== Add maven plugin @@ -767,67 +766,6 @@ In order to fix this issue, provide the following section in your `pom.xml`: ---- -[[maven-consumer]] -==== Spring Cloud Contract Verifier on the Consumer Side - -You can also use the Spring Cloud Contract Verifier for the consumer side. To do so, use -the plugin so that it only converts the contracts and generates the stubs. To achieve -that, you need to configure Spring Cloud Contract Verifier plugin in exactly the same way -as you would for a provider. You need to copy contracts stored in -`src/test/resources/contracts` and generate WireMock JSON stubs using the -`mvn generateStubs` command. By default, the generated WireMock mapping is stored in a -directory named `target/mappings`. From these generated mappings, your project should -create additional artifacts with a classifier of `stubs` for easy deployment to the maven -repository. - -Here is a sample configuration: - -[source,xml,indent=0] ----- - - org.springframework.cloud - spring-cloud-contract-maven-plugin - ${verifier-plugin.version} - - - - convert - generateStubs - - - - ----- - -When present, JSON stubs can be used in consumer automated tests, as shown here: - -[source,groovy,indent=0] ----- -@RunWith(SpringTestRunner.class) -@SpringBootTest -@AutoConfigureStubRunner -public class LoanApplicationServiceTests { - - @Autowired - LoanApplicationService service; - - @Test - public void shouldSuccessfullyApplyForLoan() { - //given: - LoanApplication application = - new LoanApplication(new Client("12345678901"), 123.123); - //when: - LoanApplicationResult loanApplication = service.loanApplication(application); - // then: - assertThat(loanApplication.loanApplicationStatus).isEqualTo(LoanApplicationStatus.LOAN_APPLIED); - assertThat(loanApplication.rejectionReason).isNull(); - } -} ----- -`LoanApplication` makes a call to the `FraudDetection` service. This request is handled -by a WireMock server configured with stubs generated by the Spring Cloud Contract -Verifier. - === Stubs and Transitive Dependencies The Maven and Gradle plugin that add the tasks that create the stubs jar for you. One @@ -872,6 +810,24 @@ For example, you might decide to have no dependencies at all. As a consumer, if you add the stub dependency to your classpath, you can explicitly exclude the unwanted dependencies. +=== CI Server setup + +When fetching stubs / contracts in a CI, shared environment, what might happen is that +both the producer and the consumer reuse the same local Maven repository. Due to this, +the framework, responsible for downloading a stub JAR from remote location, +can't decide which JAR should be picked, local or remote one. That caused +the `"The artifact was found in the local repository but you have explicitly +stated that it should be downloaded from a remote one"` exception +and failed the build. + +For such cases we're introducing the property mechanism: + +- via `stubrunner.snapshot-check.skip` system property +- via `STUBRUNNER_SNAPSHOT_CHECK_SKIP` environment variable + +if either of these values is set to `true`, then the stub downloader will not +verify the origin of the downloaded JAR. + === Scenarios You can handle scenarios with Spring Cloud Contract Verifier. All you need to do is to diff --git a/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/AetherStubDownloader.java b/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/AetherStubDownloader.java index fb1743ae79..759c0d24ea 100644 --- a/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/AetherStubDownloader.java +++ b/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/AetherStubDownloader.java @@ -72,6 +72,8 @@ public class AetherStubDownloader implements StubDownloader { private static final String ARTIFACT_EXTENSION = "jar"; private static final String LATEST_ARTIFACT_VERSION = "(,]"; private static final String LATEST_VERSION_IN_IVY = "+"; + private static final String STUBRUNNER_SNAPSHOT_CHECK_SKIP_SYSTEM_PROP = "stubrunner.snapshot-check.skip"; + private static final String STUBRUNNER_SNAPSHOT_CHECK_SKIP_ENV_VAR = "STUBRUNNER_SNAPSHOT_CHECK_SKIP"; private final List remoteRepos; private final RepositorySystem repositorySystem; @@ -170,7 +172,7 @@ public class AetherStubDownloader implements StubDownloader { ArtifactResult result = this.repositorySystem.resolveArtifact(this.session, request); log.info("Resolved artifact [" + artifact + "] to " + result.getArtifact().getFile()); - if (resolvedFromLocalRepo(result) && shouldDownloadFromRemote()) { + if (!skipSnapshotCheck() && resolvedFromLocalRepo(result) && shouldDownloadFromRemote()) { throw new IllegalStateException("The artifact was found in the local repository " + "but you have explicitly stated that it should be downloaded from a remote one"); } @@ -189,7 +191,17 @@ public class AetherStubDownloader implements StubDownloader { + "] and classifier [" + classifier + "] in " + this.remoteRepos, e); } + } + private boolean skipSnapshotCheck() { + String skipSnapCheckProp = System.getProperty(STUBRUNNER_SNAPSHOT_CHECK_SKIP_SYSTEM_PROP); + String skipSnapCheckEnv = getSkipSnapEnvProp(); + return Boolean.parseBoolean(skipSnapCheckProp) || Boolean.parseBoolean(skipSnapCheckEnv); + } + + // Visible for testing + String getSkipSnapEnvProp() { + return System.getenv(STUBRUNNER_SNAPSHOT_CHECK_SKIP_ENV_VAR); } private boolean resolvedFromLocalRepo(ArtifactResult result) { diff --git a/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/StubRunnerOptions.java b/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/StubRunnerOptions.java index 392e5cb2d0..a80ba9fb8f 100644 --- a/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/StubRunnerOptions.java +++ b/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/StubRunnerOptions.java @@ -24,7 +24,7 @@ import org.springframework.cloud.contract.stubrunner.util.StringUtils; /** * Technical options related to running StubRunner * - * Use {@class StubRunnerOptionsBuilder} to build this object. + * Use {@see StubRunnerOptionsBuilder} to build this object. * * @see StubRunnerOptionsBuilder */ diff --git a/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/AetherStubDownloaderSpec.groovy b/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/AetherStubDownloaderSpec.groovy index 7cfeb41c70..95a98560c8 100644 --- a/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/AetherStubDownloaderSpec.groovy +++ b/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/AetherStubDownloaderSpec.groovy @@ -3,93 +3,133 @@ package org.springframework.cloud.contract.stubrunner import io.specto.hoverfly.junit.HoverflyRule import org.eclipse.aether.RepositorySystemSession import org.junit.Rule -import org.springframework.util.ResourceUtils import spock.lang.Ignore import spock.lang.Specification import spock.util.environment.RestoreSystemProperties +import org.springframework.util.ResourceUtils + class AetherStubDownloaderSpec extends Specification { - @Rule - HoverflyRule hoverflyRule = HoverflyRule.inSimulationMode("simulation.json") + @Rule + HoverflyRule hoverflyRule = HoverflyRule.inSimulationMode("simulation.json") - // CI tools sometimes can't reach the `test.jfrog.io` address - // @IgnoreIf({ Boolean.valueOf(env['CI']) }) - @Ignore("There's sth wrong with the test jfrog API") - def 'Should be able to download from a repository using username and password authentication'() { - given: - StubRunnerOptions stubRunnerOptions = new StubRunnerOptionsBuilder() - .withUsername("andrew.morgan") - .withPassword("k+hbZp8rpolRucXB09dGE/CxPXxidQryQUYSGbeo6JE=") - .withProxy("localhost", hoverflyRule.proxyPort) - .withStubRepositoryRoot("https://test.jfrog.io/test/libs-snapshot-local") - .build() + // CI tools sometimes can't reach the `test.jfrog.io` address + // @IgnoreIf({ Boolean.valueOf(env['CI']) }) + @Ignore("There's sth wrong with the test jfrog API") + def 'Should be able to download from a repository using username and password authentication'() { + given: + StubRunnerOptions stubRunnerOptions = new StubRunnerOptionsBuilder() + .withUsername("andrew.morgan") + .withPassword("k+hbZp8rpolRucXB09dGE/CxPXxidQryQUYSGbeo6JE=") + .withProxy("localhost", hoverflyRule.proxyPort) + .withStubRepositoryRoot("https://test.jfrog.io/test/libs-snapshot-local") + .build() - AetherStubDownloader aetherStubDownloader = new AetherStubDownloader(stubRunnerOptions) + AetherStubDownloader aetherStubDownloader = new AetherStubDownloader(stubRunnerOptions) - when: - def jar = aetherStubDownloader.downloadAndUnpackStubJar(new StubConfiguration("io.test", "test-simulations-svc", "1.0-SNAPSHOT")) + when: + def jar = aetherStubDownloader.downloadAndUnpackStubJar(new StubConfiguration("io.test", "test-simulations-svc", "1.0-SNAPSHOT")) - then: - jar != null - } + then: + jar != null + } - def 'Should throw an exception when artifact not found'() { - given: - StubRunnerOptions stubRunnerOptions = new StubRunnerOptionsBuilder() - .withWorkOffline(true) - .build() + def 'Should throw an exception when artifact not found'() { + given: + StubRunnerOptions stubRunnerOptions = new StubRunnerOptionsBuilder() + .withWorkOffline(true) + .build() - AetherStubDownloader aetherStubDownloader = new AetherStubDownloader(stubRunnerOptions) + AetherStubDownloader aetherStubDownloader = new AetherStubDownloader(stubRunnerOptions) - when: - def jar = aetherStubDownloader.downloadAndUnpackStubJar(new StubConfiguration("non.existing.group", "missing-artifact-id", "1.0-SNAPSHOT")) + when: + def jar = aetherStubDownloader.downloadAndUnpackStubJar(new StubConfiguration("non.existing.group", "missing-artifact-id", "1.0-SNAPSHOT")) - then: - IllegalStateException e = thrown(IllegalStateException) - e.message.contains("Exception occurred while trying to download a stub for group") - } + then: + IllegalStateException e = thrown(IllegalStateException) + e.message.contains("Exception occurred while trying to download a stub for group") + } - def 'Should throw an exception when a jar is in local m2 and not in remote repo'() { - given: - StubRunnerOptions stubRunnerOptions = new StubRunnerOptionsBuilder() - .withStubRepositoryRoot("https://test.jfrog.io/test/libs-snapshot-local") - .build() + def 'Should throw an exception when a jar is in local m2 and not in remote repo'() { + given: + StubRunnerOptions stubRunnerOptions = new StubRunnerOptionsBuilder() + .withStubRepositoryRoot("https://test.jfrog.io/test/libs-snapshot-local") + .build() - AetherStubDownloader aetherStubDownloader = new AetherStubDownloader(stubRunnerOptions) + AetherStubDownloader aetherStubDownloader = new AetherStubDownloader(stubRunnerOptions) - when: - def jar = aetherStubDownloader.downloadAndUnpackStubJar(new StubConfiguration("org.springframework.cloud", "spring-cloud-contract-spec", "+", "")) + when: + def jar = aetherStubDownloader.downloadAndUnpackStubJar(new StubConfiguration("org.springframework.cloud", "spring-cloud-contract-spec", "+", "")) - then: - IllegalStateException e = thrown(IllegalStateException) - e.message.contains("The artifact was found in the local repository but you have explicitly stated that it should be downloaded from a remote one") - } + then: + IllegalStateException e = thrown(IllegalStateException) + e.message.contains("The artifact was found in the local repository but you have explicitly stated that it should be downloaded from a remote one") + } - @RestoreSystemProperties - def 'Should use local repository from settings.xml'() { - given: - File tempSettings = File.createTempFile("settings", ".xml") - def m2repoFolder = 'm2repo' + File.separator + 'repository' - tempSettings.text = '' + - ResourceUtils.getFile(ResourceUtils.CLASSPATH_URL_PREFIX + m2repoFolder).getAbsolutePath() + '' - System.setProperty("org.apache.maven.user-settings", tempSettings.getAbsolutePath()) - RepositorySystemSession repositorySystemSession = - AetherFactories.newSession(AetherFactories.newRepositorySystem(), true); + @RestoreSystemProperties + def 'Should not throw an exception when a jar is in local m2 and not in remote repo and system property disabled snapshot check'() { + given: + StubRunnerOptions stubRunnerOptions = new StubRunnerOptionsBuilder() + .withStubRepositoryRoot("https://test.jfrog.io/test/libs-snapshot-local") + .build() - and: - StubRunnerOptions stubRunnerOptions = new StubRunnerOptionsBuilder() - .withWorkOffline(true) - .build() - AetherStubDownloader aetherStubDownloader = new AetherStubDownloader(stubRunnerOptions) + AetherStubDownloader aetherStubDownloader = new AetherStubDownloader(stubRunnerOptions) - when: - def jar = aetherStubDownloader.downloadAndUnpackStubJar( - new StubConfiguration("org.springframework.cloud.contract.verifier.stubs", - "bootService", "0.0.1-SNAPSHOT")) + and: + System.properties.setProperty("stubrunner.snapshot-check.skip", "true") - then: - jar != null - repositorySystemSession.getLocalRepository().getBasedir().getAbsolutePath().endsWith(m2repoFolder) - } + when: + def jar = aetherStubDownloader.downloadAndUnpackStubJar(new StubConfiguration("org.springframework.cloud", "spring-cloud-contract-spec", "+", "")) + + then: + jar != null + } + + def 'Should not throw an exception when a jar is in local m2 and not in remote repo and env property disabled snapshot check'() { + given: + StubRunnerOptions stubRunnerOptions = new StubRunnerOptionsBuilder() + .withStubRepositoryRoot("https://test.jfrog.io/test/libs-snapshot-local") + .build() + + AetherStubDownloader aetherStubDownloader = new AetherStubDownloader(stubRunnerOptions) { + @Override + String getSkipSnapEnvProp() { + return "true" + } + } + + when: + def jar = aetherStubDownloader.downloadAndUnpackStubJar(new StubConfiguration("org.springframework.cloud", "spring-cloud-contract-spec", "+", "")) + + then: + jar != null + } + + @RestoreSystemProperties + def 'Should use local repository from settings.xml'() { + given: + File tempSettings = File.createTempFile("settings", ".xml") + def m2repoFolder = 'm2repo' + File.separator + 'repository' + tempSettings.text = '' + + ResourceUtils.getFile(ResourceUtils.CLASSPATH_URL_PREFIX + m2repoFolder).getAbsolutePath() + '' + System.setProperty("org.apache.maven.user-settings", tempSettings.getAbsolutePath()) + RepositorySystemSession repositorySystemSession = + AetherFactories.newSession(AetherFactories.newRepositorySystem(), true); + + and: + StubRunnerOptions stubRunnerOptions = new StubRunnerOptionsBuilder() + .withWorkOffline(true) + .build() + AetherStubDownloader aetherStubDownloader = new AetherStubDownloader(stubRunnerOptions) + + when: + def jar = aetherStubDownloader.downloadAndUnpackStubJar( + new StubConfiguration("org.springframework.cloud.contract.verifier.stubs", + "bootService", "0.0.1-SNAPSHOT")) + + then: + jar != null + repositorySystemSession.getLocalRepository().getBasedir().getAbsolutePath().endsWith(m2repoFolder) + } } From a2d866dd39cc4ea176918868cbe198b5290272ef Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Fri, 16 Feb 2018 13:37:11 +0100 Subject: [PATCH 2/3] Bumped versions --- pom.xml | 12 ++++++------ spring-cloud-contract-dependencies/pom.xml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 6670651e8e..2c87e7b58e 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.springframework.cloud spring-cloud-build - 1.3.8.RELEASE + 1.3.9.BUILD-SNAPSHOT @@ -26,12 +26,12 @@ 5.12.1 2.18.3 2.17 - 1.3.8.RELEASE - 1.2.0.BUILD-SNAPSHOT + 1.3.9.BUILD-SNAPSHOT + 1.2.1.BUILD-SNAPSHOT Ditmars.BUILD-SNAPSHOT - 1.4.2.BUILD-SNAPSHOT - 1.2.3.BUILD-SNAPSHOT - 1.3.1.BUILD-SNAPSHOT + 1.4.4.BUILD-SNAPSHOT + 1.3.3.BUILD-SNAPSHOT + 1.3.3.BUILD-SNAPSHOT diff --git a/spring-cloud-contract-dependencies/pom.xml b/spring-cloud-contract-dependencies/pom.xml index c41c5f84ba..9b93f3ddf2 100644 --- a/spring-cloud-contract-dependencies/pom.xml +++ b/spring-cloud-contract-dependencies/pom.xml @@ -5,7 +5,7 @@ spring-cloud-dependencies-parent org.springframework.cloud - 1.3.8.BUILD-SNAPSHOT + 1.3.9.BUILD-SNAPSHOT spring-cloud-contract-dependencies From c8ec61c1c203f68c03a7f4eaf6d1199ecc05fe79 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Fri, 16 Feb 2018 14:06:33 +0100 Subject: [PATCH 3/3] Changed the snapshot skip test property --- docs/src/main/asciidoc/verifier_setup.adoc | 2 +- .../cloud/contract/stubrunner/AetherStubDownloader.java | 2 +- .../cloud/contract/stubrunner/AetherStubDownloaderSpec.groovy | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/src/main/asciidoc/verifier_setup.adoc b/docs/src/main/asciidoc/verifier_setup.adoc index 178e37fbe9..4d705ea6cb 100644 --- a/docs/src/main/asciidoc/verifier_setup.adoc +++ b/docs/src/main/asciidoc/verifier_setup.adoc @@ -822,7 +822,7 @@ and failed the build. For such cases we're introducing the property mechanism: -- via `stubrunner.snapshot-check.skip` system property +- via `stubrunner.snapshot-check-skip` system property - via `STUBRUNNER_SNAPSHOT_CHECK_SKIP` environment variable if either of these values is set to `true`, then the stub downloader will not diff --git a/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/AetherStubDownloader.java b/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/AetherStubDownloader.java index 759c0d24ea..124b41d635 100644 --- a/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/AetherStubDownloader.java +++ b/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/AetherStubDownloader.java @@ -72,7 +72,7 @@ public class AetherStubDownloader implements StubDownloader { private static final String ARTIFACT_EXTENSION = "jar"; private static final String LATEST_ARTIFACT_VERSION = "(,]"; private static final String LATEST_VERSION_IN_IVY = "+"; - private static final String STUBRUNNER_SNAPSHOT_CHECK_SKIP_SYSTEM_PROP = "stubrunner.snapshot-check.skip"; + private static final String STUBRUNNER_SNAPSHOT_CHECK_SKIP_SYSTEM_PROP = "stubrunner.snapshot-check-skip"; private static final String STUBRUNNER_SNAPSHOT_CHECK_SKIP_ENV_VAR = "STUBRUNNER_SNAPSHOT_CHECK_SKIP"; private final List remoteRepos; diff --git a/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/AetherStubDownloaderSpec.groovy b/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/AetherStubDownloaderSpec.groovy index 95a98560c8..6ac7a212cc 100644 --- a/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/AetherStubDownloaderSpec.groovy +++ b/spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/stubrunner/AetherStubDownloaderSpec.groovy @@ -77,7 +77,7 @@ class AetherStubDownloaderSpec extends Specification { AetherStubDownloader aetherStubDownloader = new AetherStubDownloader(stubRunnerOptions) and: - System.properties.setProperty("stubrunner.snapshot-check.skip", "true") + System.properties.setProperty("stubrunner.snapshot-check-skip", "true") when: def jar = aetherStubDownloader.downloadAndUnpackStubJar(new StubConfiguration("org.springframework.cloud", "spring-cloud-contract-spec", "+", ""))