From 2f8eccc582011494eaf91ea236e2962378ca4df8 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Tue, 24 Oct 2017 18:28:54 +0200 Subject: [PATCH 1/3] Fixing the inheritance issue --- .../spring-cloud-contract-maven-plugin/src/site/site.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/site/site.xml b/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/site/site.xml index eba8b332f0..e1691b453a 100644 --- a/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/site/site.xml +++ b/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/site/site.xml @@ -16,7 +16,7 @@ limitations under the License. --> - + ${project.name} From 05db1d0933c78f36c37eb583a657a4428255a677 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Tue, 24 Oct 2017 18:29:05 +0200 Subject: [PATCH 2/3] Removing file feature from docs --- docs/src/main/asciidoc/verifier_contract.adoc | 43 ------------------- 1 file changed, 43 deletions(-) diff --git a/docs/src/main/asciidoc/verifier_contract.adoc b/docs/src/main/asciidoc/verifier_contract.adoc index 29044560df..4b7f850397 100644 --- a/docs/src/main/asciidoc/verifier_contract.adoc +++ b/docs/src/main/asciidoc/verifier_contract.adoc @@ -89,49 +89,6 @@ plugin configuration or set the `ignored` property on the contract itself: include::{contract_spec_path}/src/test/groovy/org/springframework/cloud/contract/spec/internal/ContractSpec.groovy[tags=ignored,indent=0] ---- -[[contract-dsl-passing-values-from-files]] -==== Passing Values from Files - -Starting with version `1.2.0`, you can pass values from files. Assume that you have the -following resources in our project. - -[source,bash,indent=0] ----- -└── src -    └── test -       └── resources -          └── contracts -    ├── readFromFile.groovy -    ├── request.json -    └── response.json ----- - -Further assume that your contract is as follows: - -[source,groovy,indent=0] ----- -include::{verifier_core_path}/src/test/resources/classpath/readFromFile.groovy[indent=0] ----- - -Further assume that the JSON files is as follows: - -*request.json* -[source,json,indent=0] ----- -include::{verifier_core_path}/src/test/resources/classpath/request.json[indent=0] ----- - -*response.json* -[source,json,indent=0] ----- -include::{verifier_core_path}/src/test/resources/classpath/response.json[indent=0] ----- - -When test or stub generation takes place, the contents of the file is passed to the body -of a request or a response. That works because of the `file(...)` method. The argument of -that method needs to be a file with location relative to the folder in which the contract -lays. - [[contract-dsl-http-top-level-elements]] ==== HTTP Top-Level Elements From dc0ffd587eaf14110cc386ef0d907bfee46bdbfd Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Tue, 24 Oct 2017 18:33:19 +0200 Subject: [PATCH 3/3] Merged 1.1.x --- docs/src/main/asciidoc/verifier_contract.adoc | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/docs/src/main/asciidoc/verifier_contract.adoc b/docs/src/main/asciidoc/verifier_contract.adoc index 4b7f850397..3da6b52f67 100644 --- a/docs/src/main/asciidoc/verifier_contract.adoc +++ b/docs/src/main/asciidoc/verifier_contract.adoc @@ -89,6 +89,49 @@ plugin configuration or set the `ignored` property on the contract itself: include::{contract_spec_path}/src/test/groovy/org/springframework/cloud/contract/spec/internal/ContractSpec.groovy[tags=ignored,indent=0] ---- +[[contract-dsl-passing-values-from-files]] +==== Passing Values from Files + +Starting with version `1.2.0`, you can pass values from files. Assume that you have the +following resources in our project. + +[source,bash,indent=0] +---- +└── src +    └── test +       └── resources +          └── contracts +    ├── readFromFile.groovy +    ├── request.json +    └── response.json +---- + +Further assume that your contract is as follows: + +[source,groovy,indent=0] +---- +include::{verifier_core_path}/src/test/resources/classpath/readFromFile.groovy[indent=0] +---- + +Further assume that the JSON files is as follows: + +*request.json* +[source,json,indent=0] +---- +include::{verifier_core_path}/src/test/resources/classpath/request.json[indent=0] +---- + +*response.json* +[source,json,indent=0] +---- +include::{verifier_core_path}/src/test/resources/classpath/response.json[indent=0] +---- + +When test or stub generation takes place, the contents of the file is passed to the body +of a request or a response. That works because of the `file(...)` method. The argument of +that method needs to be a file with location relative to the folder in which the contract +lays. + [[contract-dsl-http-top-level-elements]] ==== HTTP Top-Level Elements @@ -512,7 +555,7 @@ The following is an example of a custom extension: .TestWireMockExtensions.groovy [source,groovy,indent=0] ---- -include::{stubrunner_core_path}/src/test/groovy/org/springframework/cloud/contract/verifier/dsl/wiremock/TestWireMockExtensions.groovy[indent=0] +include::{verifier_core_path}/src/test/groovy/org/springframework/cloud/contract/verifier/dsl/wiremock/TestWireMockExtensions.groovy[indent=0] ---- IMPORTANT: Remember to override the `applyGlobally()` method and set it to `false` if you