[{
+[{
"id" : "f9152eb9-bf77-4c38-8289-90be7d10d0d7",
"request" : {
"url" : "/name",
@@ -4641,7 +4671,7 @@ mappings available for the given server:
"uuid" : "f9152eb9-bf77-4c38-8289-90be7d10d0d7"
},
...
-]
+]
diff --git a/spring-cloud-contract-maven-plugin/checkstyle.html b/spring-cloud-contract-maven-plugin/checkstyle.html index 897e13f413..81a34f8949 100644 --- a/spring-cloud-contract-maven-plugin/checkstyle.html +++ b/spring-cloud-contract-maven-plugin/checkstyle.html @@ -1,13 +1,13 @@
- +Full name:
-org.springframework.cloud:spring-cloud-contract-maven-plugin:2.0.0.BUILD-SNAPSHOT:convert
+org.springframework.cloud:spring-cloud-contract-maven-plugin:1.2.0.BUILD-SNAPSHOT:convert
Description:
@@ -304,7 +304,7 @@ stubs mappings.This parameter is only used when goal is executed outside of -maven project.
Full name:
-org.springframework.cloud:spring-cloud-contract-maven-plugin:2.0.0.BUILD-SNAPSHOT:generateStubs
+org.springframework.cloud:spring-cloud-contract-maven-plugin:1.2.0.BUILD-SNAPSHOT:generateStubs
Description:
@@ -336,7 +336,7 @@ to be executed firstFull name:
-org.springframework.cloud:spring-cloud-contract-maven-plugin:2.0.0.BUILD-SNAPSHOT:generateTests
+org.springframework.cloud:spring-cloud-contract-maven-plugin:1.2.0.BUILD-SNAPSHOT:generateTests
Description:
@@ -306,7 +306,7 @@ tests on the producer sideFull name:
-org.springframework.cloud:spring-cloud-contract-maven-plugin:2.0.0.BUILD-SNAPSHOT:help
+org.springframework.cloud:spring-cloud-contract-maven-plugin:1.2.0.BUILD-SNAPSHOT:help
Description:
@@ -274,6 +274,11 @@ Call mvn spring-cloud-contract:help -Ddetail=trueAttributes:
+mvn spring-cloud-contract:help -Ddetail=true
<plugin>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
- <version>2.0.0.BUILD-SNAPSHOT</version>
+ <version>1.2.0.BUILD-SNAPSHOT</version>
</plugin>
...
</plugins>
@@ -336,7 +336,7 @@ Call mvn spring-cloud-contract:help -Ddetail=true
<plugin>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
- <version>2.0.0.BUILD-SNAPSHOT</version>
+ <version>1.2.0.BUILD-SNAPSHOT</version>
</plugin>
...
</plugins>
diff --git a/spring-cloud-contract-maven-plugin/plugin-management.html b/spring-cloud-contract-maven-plugin/plugin-management.html
index 1d6443751c..ca8fa51101 100644
--- a/spring-cloud-contract-maven-plugin/plugin-management.html
+++ b/spring-cloud-contract-maven-plugin/plugin-management.html
@@ -1,13 +1,13 @@
-
+
Spring Cloud Contract Maven Plugin – Project Plugin Management
@@ -146,10 +146,10 @@
- - Last Published: 2017-07-13
+
- Last Published: 2017-07-18
|
- - Version: 2.0.0.BUILD-SNAPSHOT
+
- Version: 1.2.0.BUILD-SNAPSHOT
@@ -340,16 +340,8 @@
2.2-beta-5
org.apache.maven.plugins
-maven-compiler-plugin
-3.1
-
-org.apache.maven.plugins
maven-dependency-plugin
2.8
-
-org.apache.maven.plugins
-maven-eclipse-plugin
-2.10
org.apache.maven.plugins
maven-enforcer-plugin
@@ -365,7 +357,7 @@
org.apache.maven.plugins
maven-plugin-plugin
-3.5
+3.4
org.apache.maven.plugins
maven-release-plugin
@@ -409,7 +401,7 @@
org.springframework.boot
spring-boot-maven-plugin
-2.0.0.M2
+1.5.5.BUILD-SNAPSHOT
pl.project13.maven
git-commit-id-plugin
diff --git a/spring-cloud-contract-maven-plugin/plugins.html b/spring-cloud-contract-maven-plugin/plugins.html
index 6b42da7eca..a9f0177e1f 100644
--- a/spring-cloud-contract-maven-plugin/plugins.html
+++ b/spring-cloud-contract-maven-plugin/plugins.html
@@ -1,13 +1,13 @@
-
+
Spring Cloud Contract Maven Plugin – Project Plugins
@@ -146,10 +146,10 @@
- - Last Published: 2017-07-13
+
- Last Published: 2017-07-18
|
- - Version: 2.0.0.BUILD-SNAPSHOT
+
- Version: 1.2.0.BUILD-SNAPSHOT
@@ -365,7 +365,7 @@
org.apache.maven.plugins
maven-plugin-plugin
-3.5
+3.4
org.apache.maven.plugins
maven-resources-plugin
@@ -391,14 +391,18 @@
gmavenplus-plugin
1.5
+org.codehaus.mojo
+animal-sniffer-maven-plugin
+1.14
+
org.codehaus.plexus
plexus-component-metadata
1.6
-
+
org.eluder.coveralls
coveralls-maven-plugin
4.1.0
-
+
org.jacoco
http://jacoco-maven-plugin
0.7.9
@@ -416,7 +420,7 @@
org.apache.maven.plugins
maven-plugin-plugin
-3.5
+3.4
org.apache.maven.plugins
maven-project-info-reports-plugin
diff --git a/spring-cloud-contract-maven-plugin/project-info.html b/spring-cloud-contract-maven-plugin/project-info.html
index 29d5f791f0..cff810e8c7 100644
--- a/spring-cloud-contract-maven-plugin/project-info.html
+++ b/spring-cloud-contract-maven-plugin/project-info.html
@@ -1,13 +1,13 @@
-
+
Spring Cloud Contract Maven Plugin – Project Information
@@ -146,10 +146,10 @@
- - Last Published: 2017-07-13
+
- Last Published: 2017-07-18
|
- - Version: 2.0.0.BUILD-SNAPSHOT
+
- Version: 1.2.0.BUILD-SNAPSHOT
diff --git a/spring-cloud-contract-maven-plugin/project-reports.html b/spring-cloud-contract-maven-plugin/project-reports.html
index db129285fa..7d655612ac 100644
--- a/spring-cloud-contract-maven-plugin/project-reports.html
+++ b/spring-cloud-contract-maven-plugin/project-reports.html
@@ -1,13 +1,13 @@
-
+
Spring Cloud Contract Maven Plugin – Generated Reports
@@ -146,10 +146,10 @@
- - Last Published: 2017-07-13
+
- Last Published: 2017-07-18
|
- - Version: 2.0.0.BUILD-SNAPSHOT
+
- Version: 1.2.0.BUILD-SNAPSHOT
diff --git a/spring-cloud-contract-maven-plugin/project-summary.html b/spring-cloud-contract-maven-plugin/project-summary.html
index af894e45e8..01578630d1 100644
--- a/spring-cloud-contract-maven-plugin/project-summary.html
+++ b/spring-cloud-contract-maven-plugin/project-summary.html
@@ -1,13 +1,13 @@
-
+
Spring Cloud Contract Maven Plugin – Project Summary
@@ -146,10 +146,10 @@
- - Last Published: 2017-07-13
+
- Last Published: 2017-07-18
|
- - Version: 2.0.0.BUILD-SNAPSHOT
+
- Version: 1.2.0.BUILD-SNAPSHOT
@@ -362,7 +362,7 @@
spring-cloud-contract-maven-plugin
Version
-2.0.0.BUILD-SNAPSHOT
+1.2.0.BUILD-SNAPSHOT
Type
maven-plugin
diff --git a/spring-cloud-contract-maven-plugin/run-mojo.html b/spring-cloud-contract-maven-plugin/run-mojo.html
index 72d7d95c47..cf488a8b18 100644
--- a/spring-cloud-contract-maven-plugin/run-mojo.html
+++ b/spring-cloud-contract-maven-plugin/run-mojo.html
@@ -1,13 +1,13 @@
-
+
Spring Cloud Contract Maven Plugin – spring-cloud-contract:run
@@ -146,10 +146,10 @@
- - Last Published: 2017-07-13
+
- Last Published: 2017-07-18
|
- - Version: 2.0.0.BUILD-SNAPSHOT
+
- Version: 1.2.0.BUILD-SNAPSHOT
@@ -263,7 +263,7 @@
Full name:
-org.springframework.cloud:spring-cloud-contract-maven-plugin:2.0.0.BUILD-SNAPSHOT:run
+org.springframework.cloud:spring-cloud-contract-maven-plugin:1.2.0.BUILD-SNAPSHOT:run
Description:
@@ -300,7 +300,7 @@
-
-(no description)
Default value is: ${basedir}.
User property is: stubsDirectory.
+(no description)
Default value is: ${basedir}.
User property is: stubsDirectory.
@@ -311,7 +311,7 @@
-
-HTTP port for WireMock server
Default value is: 8080.
User property is: spring.cloud.contract.verifier.http.port.
+HTTP port for WireMock server
Default value is: 8080.
User property is: spring.cloud.contract.verifier.http.port.
@@ -322,7 +322,7 @@
-
-(no description)
Default value is: 15000.
User property is: spring.cloud.contract.verifier.http.maxPort.
+(no description)
Default value is: 15000.
User property is: spring.cloud.contract.verifier.http.maxPort.
@@ -333,7 +333,7 @@
-
-(no description)
Default value is: 10000.
User property is: spring.cloud.contract.verifier.http.minPort.
+(no description)
Default value is: 10000.
User property is: spring.cloud.contract.verifier.http.minPort.
@@ -344,7 +344,7 @@
-
-Set this to "true" to bypass verifier execution.
Default value is: false.
User property is: spring.cloud.contract.verifier.skip.
+Set this to "true" to bypass verifier execution.
Default value is: false.
User property is: spring.cloud.contract.verifier.skip.
@@ -355,7 +355,7 @@
-
-Set this to "true" to bypass verifier test generation.
Default value is: false.
User property is: spring.cloud.contract.verifier.skipTestOnly.
+Set this to "true" to bypass verifier test generation.
Default value is: false.
User property is: spring.cloud.contract.verifier.skipTestOnly.
@@ -366,7 +366,7 @@
-
-(no description)
User property is: spring.cloud.contract.verifier.stubs.
+(no description)
User property is: spring.cloud.contract.verifier.stubs.
diff --git a/spring-cloud-contract-maven-plugin/sitemap.html b/spring-cloud-contract-maven-plugin/sitemap.html
index 5bb46d17d9..6b7a31fca9 100644
--- a/spring-cloud-contract-maven-plugin/sitemap.html
+++ b/spring-cloud-contract-maven-plugin/sitemap.html
@@ -1,13 +1,13 @@
-
+
Spring Cloud Contract Maven Plugin – Sitemap
@@ -146,10 +146,10 @@
- - Last Published: 2017-07-13
+
- Last Published: 2017-07-18
|
- - Version: 2.0.0.BUILD-SNAPSHOT
+
- Version: 1.2.0.BUILD-SNAPSHOT
diff --git a/spring-cloud-contract-maven-plugin/source-repository.html b/spring-cloud-contract-maven-plugin/source-repository.html
index 2b4fc8ec73..465a183e69 100644
--- a/spring-cloud-contract-maven-plugin/source-repository.html
+++ b/spring-cloud-contract-maven-plugin/source-repository.html
@@ -1,13 +1,13 @@
-
+
Spring Cloud Contract Maven Plugin – Source Code Management
@@ -146,10 +146,10 @@
- - Last Published: 2017-07-13
+
- Last Published: 2017-07-18
|
- - Version: 2.0.0.BUILD-SNAPSHOT
+
- Version: 1.2.0.BUILD-SNAPSHOT
diff --git a/spring-cloud-contract-maven-plugin/spock.html b/spring-cloud-contract-maven-plugin/spock.html
index 2db4a93d9a..797be17ebe 100644
--- a/spring-cloud-contract-maven-plugin/spock.html
+++ b/spring-cloud-contract-maven-plugin/spock.html
@@ -1,13 +1,13 @@
-
+
Spring Cloud Contract Maven Plugin –
@@ -146,10 +146,10 @@
- - Last Published: 2017-07-13
+
- Last Published: 2017-07-18
|
- - Version: 2.0.0.BUILD-SNAPSHOT
+
- Version: 1.2.0.BUILD-SNAPSHOT
@@ -267,7 +267,6 @@
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
- <version>1.0-groovy-2.4</version>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/spring-cloud-contract-maven-plugin/team-list.html b/spring-cloud-contract-maven-plugin/team-list.html
index 672e515864..b91882de1f 100644
--- a/spring-cloud-contract-maven-plugin/team-list.html
+++ b/spring-cloud-contract-maven-plugin/team-list.html
@@ -1,13 +1,13 @@
-
+
Spring Cloud Contract Maven Plugin – Project Team
@@ -146,10 +146,10 @@
- - Last Published: 2017-07-13
+
- Last Published: 2017-07-18
|
- - Version: 2.0.0.BUILD-SNAPSHOT
+
- Version: 1.2.0.BUILD-SNAPSHOT
diff --git a/spring-cloud-contract-maven-plugin/usage.html b/spring-cloud-contract-maven-plugin/usage.html
index a3899b4fd1..bee0716032 100644
--- a/spring-cloud-contract-maven-plugin/usage.html
+++ b/spring-cloud-contract-maven-plugin/usage.html
@@ -1,13 +1,13 @@
-
+
Spring Cloud Contract Maven Plugin –
@@ -146,10 +146,10 @@
- - Last Published: 2017-07-13
+
- Last Published: 2017-07-18
|
- - Version: 2.0.0.BUILD-SNAPSHOT
+
- Version: 1.2.0.BUILD-SNAPSHOT
diff --git a/spring-cloud-contract.html b/spring-cloud-contract.html
index 970bc1a7f4..785c3340de 100644
--- a/spring-cloud-contract.html
+++ b/spring-cloud-contract.html
@@ -559,6 +559,7 @@ $(addBlockSwitches);
- How can I debug the request/response being sent by the generated tests client?
- How can I see what got registered in the HTTP server stub?
- Can I reference the request from the response?
+- Can I reference text from file?
- Spring Cloud Contract Verifier HTTP
@@ -770,6 +771,7 @@ $(addBlockSwitches);
- Description
- Name
- Ignoring contracts
+- Passing values from files
- HTTP Top-Level Elements
@@ -875,7 +877,7 @@ $(addBlockSwitches);
Olga Maciaszek-Sharma, Mariusz Smykuła, Dave Syer
-2.0.0.BUILD-SNAPSHOT
+1.2.0.BUILD-SNAPSHOT
@@ -2615,6 +2617,13 @@ started will be attached.
for this for WireMock. In case of other HTTP server stubs you’ll have to implement the approach yourself.
+
+Can I reference text from file?
+
+Yes! With version 1.2.0 we’ve added such a possibility. It’s enough to call file(…) method in the
+DSL and provide a path relative to where the contract lays.
+
+
Spring Cloud Contract Verifier HTTP
@@ -2781,7 +2790,9 @@ src/test/resources/contracts/myservice/shouldReturnUser.groovy
}
contractsPath = ''
contractsWorkOffline = false
- cacheDownloadedContracts = true
+ contractRepository {
+ cacheDownloadedContracts(true)
+ }
}
tasks.create(type: Jar, name: 'verifierStubsJar', dependsOn: 'generateClientStubs') {
@@ -3291,9 +3302,6 @@ the test class generated from these contracts will extend com.example.base
-
-
contractsRepositoryUrl - URL to a repo with the artifacts with contracts, if not provided should use the current Maven ones
-
--
contractDependency - the contract dependency that contains all the packaged contracts
-
@@ -3303,12 +3311,34 @@ the test class generated from these contracts will extend
com.example.base
contractsWorkOffline - if the dependencies should be downloaded or local Maven only should be reused
-
+
contractsRepositoryUrl - DEPRECATED PROPERTY - please use the contractRepository closure - URL to a repo with the artifacts with contracts, if not provided should use the current Maven ones
+
+-
+
contractRepository - closure where you can define properties related to repository with contracts
+
+
+-
+
username - username to be used to connect to the repo
+
+-
+
password - username to be used to connect to the repo
+
+-
+
proxyHost - proxy host to be used to connect to the repo
+
+-
+
proxyPort - proxy port to be used to connect to the repo
+
+-
cacheDownloadedContracts - if you want to reuse download JARs that contain contract definitions.
We cache only non-snapshot, explicitly provided versions (e.g. + or 1.0.0.BUILD-SNAPSHOT won’t get cached).
By default this feature is turned on.
+
+
+
Single base class for all tests
@@ -4068,7 +4098,7 @@ and proper stubbed routes are created.
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
- <version>Finchley.BUILD-SNAPSHOT</version>
+ <version>Edgware.BUILD-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -4628,7 +4658,7 @@ mappings available for the given server:
-[{
+[{
"id" : "f9152eb9-bf77-4c38-8289-90be7d10d0d7",
"request" : {
"url" : "/name",
@@ -4641,7 +4671,7 @@ mappings available for the given server:
"uuid" : "f9152eb9-bf77-4c38-8289-90be7d10d0d7"
},
...
-]
+]
@@ -4748,7 +4778,7 @@ public interface StubFinder extends StubTrigger {
.repoRoot(StubRunnerRuleSpec.getResource("/m2repo/repository").toURI().toString())
.downloadStub("org.springframework.cloud.contract.verifier.stubs", "loanIssuance")
.downloadStub("org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer")
- .withMappingsOutputFolder("target/outputmappingsforule")
+ .withMappingsOutputFolder("target/outputmappingsforrule")
def 'should start WireMock servers'() {
@@ -4770,7 +4800,7 @@ def 'should output mappings to output folder'() {
when:
def url = rule.findStubUrl('fraudDetectionServer')
then:
- new File("target/outputmappingsforule", "fraudDetectionServer_${url.port}").exists()
+ new File("target/outputmappingsforrule", "fraudDetectionServer_${url.port}").exists()
}
@@ -6709,6 +6739,75 @@ or just set the ignored property on the contract itself:
+
+Passing values from files
+
+Starting with version 1.2.0 it’s possible to pass values from files. Let’s assume that we have
+the following resources in our project.
+
+
+
+└── src
+ └── test
+ └── resources
+ └── contracts
+ ├── readFromFile.groovy
+ ├── request.json
+ └── response.json
+
+
+
+And our contract looks like this:
+
+
+
+import org.springframework.cloud.contract.spec.Contract
+
+Contract.make {
+ request {
+ method('PUT')
+ headers {
+ contentType(applicationJson())
+ }
+ body(file("request.json"))
+ url("/1")
+ }
+ response {
+ status 200
+ body(file("response.json"))
+ headers {
+ contentType(textPlain())
+ }
+ }
+}
+
+
+
+and the json files look like this:
+
+
+request.json
+
+
+
+{ "status" : "REQUEST" }
+
+
+
+response.json
+
+
+
+{ "status" : "RESPONSE" }
+
+
+
+When test / stub generation takes place then the contents of the file will be
+passed to the body of request / response. All thanks to the file(…) method.
+The argument of that method needs to be a file with location relative to the
+folder in which the contract lays.
+
+
HTTP Top-Level Elements
@@ -8137,7 +8236,7 @@ real requests and you need to setup your generated test’s base class to wo
import io.restassured.RestAssured;
import org.junit.Before;
-import org.springframework.boot.web.server.LocalServerPort;
+import org.springframework.boot.context.embedded.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest(classes = ContextPathTestingBaseClass.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)