diff --git a/2.0.x/multi/multi__contract_dsl.html b/2.0.x/multi/multi__contract_dsl.html
index 2d79cedf18..ff72d82df6 100644
--- a/2.0.x/multi/multi__contract_dsl.html
+++ b/2.0.x/multi/multi__contract_dsl.html
@@ -280,7 +280,7 @@ such as named("fileName", "fileContent"), or via a
},
"response" : {
"status" : 200,
- "transformers" : [ "response-template" ]
+ "transformers" : [ "response-template", "foo-transformer" ]
}
}
'''
The response must contain an HTTP status code and may contain other information. The @@ -691,7 +691,16 @@ in sending the following response body:
}![]() | Important |
|---|---|
This feature works only with WireMock having a version greater than or equal
to 2.5.1. The Spring Cloud Contract Verifier uses WireMock’s
|
escapejsonbody: Escapes the request body in a format that can be embedded in a JSON.jsonpath: For a given parameter, find an object in the request body.If you work with Pact, the following discussion may seem familiar. +proper values. Additionally, it registers two helper functions:
escapejsonbody: Escapes the request body in a format that can be embedded in a JSON.jsonpath: For a given parameter, find an object in the request body.WireMock lets you register custom extensions. By default, Spring Cloud Contract registers
+the transformer, which lets you reference a request from a response. If you want to
+provide your own extensions, you can register an implementation of the
+org.springframework.cloud.contract.verifier.dsl.wiremock.WireMockExtensions interface.
+Since we use the spring.factories extension approach, you can create an entry in
+META-INF/spring.factories file similar to the following:
org.springframework.cloud.contract.verifier.dsl.wiremock.WireMockExtensions=\ +org.springframework.cloud.contract.stubrunner.provider.wiremock.TestWireMockExtensions
The following is an example of a custom extension:
TestWireMockExtensions.groovy. +
Unresolved directive in verifier_contract.adoc - include::../../../../spring-cloud-contract-stub-runner/src/test/groovy/org/springframework/cloud/contract/verifier/dsl/wiremock/TestWireMockExtensions.groovy[indent=0]+
![]() | Important |
|---|---|
Remember to override the |
If you work with Pact, the following discussion may seem familiar. Quite a few users are used to having a separation between the body and setting the dynamic parts of a contract.
You can use two separate sections:
stubMatchers, which lets you define the dynamic values that should end up in a stub.
You can set it in the request or inputMessage part of your contract.testMatchers, which is present in the response or outputMessage side of the
diff --git a/2.0.x/multi/multi__spring_cloud_contract_stub_runner.html b/2.0.x/multi/multi__spring_cloud_contract_stub_runner.html
index 21a59fd554..6ad5890c4d 100644
--- a/2.0.x/multi/multi__spring_cloud_contract_stub_runner.html
+++ b/2.0.x/multi/multi__spring_cloud_contract_stub_runner.html
@@ -535,7 +535,7 @@ the Stub Runner server. It will be available at port 8750<
def response = RestAssuredMockMvc.get("/stubs/${stubId}")
then:
response.statusCode == 200
- response.body.as(Integer) > 0
+ Integer.valueOf(response.body.asString()) > 0
where:
stubId << ['org.springframework.cloud.contract.verifier.stubs:bootService:+:stubs',
'org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs',
diff --git a/2.0.x/multi/multi__using_the_pluggable_architecture.html b/2.0.x/multi/multi__using_the_pluggable_architecture.html
index 63d37baab9..a2eb345370 100644
--- a/2.0.x/multi/multi__using_the_pluggable_architecture.html
+++ b/2.0.x/multi/multi__using_the_pluggable_architecture.html
@@ -60,7 +60,12 @@ conversion. Also, you must define how to perform that conversion in both directi
/META-INF/spring.factories file in which you provide the fully qualified name of your
implementation.The following example shows a typical spring.factories file:
# Converters org.springframework.cloud.contract.spec.ContractConverter=\ -org.springframework.cloud.contract.verifier.converter.YamlContractConverter
The following example shows a typical YAML implementation that matches the preceding +org.springframework.cloud.contract.verifier.converter.YamlContractConverter + +# tag::extension[] +org.springframework.cloud.contract.verifier.dsl.wiremock.WireMockExtensions=\ +org.springframework.cloud.contract.verifier.dsl.wiremock.TestWireMockExtensions +# end::extension[]
The following example shows a typical YAML implementation that matches the preceding example:
package org.springframework.cloud.contract.verifier.converter import java.nio.file.Files diff --git a/2.0.x/multi/multi_spring-cloud-contract.html b/2.0.x/multi/multi_spring-cloud-contract.html index 4ecb2b7481..914b418f22 100644 --- a/2.0.x/multi/multi_spring-cloud-contract.html +++ b/2.0.x/multi/multi_spring-cloud-contract.html @@ -1,3 +1,3 @@ -Spring Cloud Contract \ No newline at end of file +Table of Contents
- 1. Spring Cloud Contract
- 2. Spring Cloud Contract Verifier Introduction
- 3. Spring Cloud Contract Verifier Setup
- 3.1. Gradle Project
- 3.1.1. Prerequisites
- 3.1.2. Add Gradle Plugin with Dependencies
- 3.1.3. Gradle and Rest Assured 2.0
- 3.1.4. Snapshot Versions for Gradle
- 3.1.5. Add stubs
- 3.1.6. Run the Plugin
- 3.1.7. Default Setup
- 3.1.8. Configure Plugin
- 3.1.9. Configuration Options
- 3.1.10. Single Base Class for All Tests
- 3.1.11. Different Base Classes for Contracts
- 3.1.12. Invoking Generated Tests
- 3.1.13. Spring Cloud Contract Verifier on the Consumer Side
- 3.2. Maven Project
- 3.2.1. Add maven plugin
- 3.2.2. Maven and Rest Assured 2.0
- 3.2.3. Snapshot versions for Maven
- 3.2.4. Add stubs
- 3.2.5. Run plugin
- 3.2.6. Configure plugin
- 3.2.7. Configuration Options
- 3.2.8. Single Base Class for All Tests
- 3.2.9. Different base classes for contracts
- 3.2.10. Invoking generated tests
- 3.2.11. Maven Plugin and STS
- 3.2.12. Spring Cloud Contract Verifier on the Consumer Side
- 3.3. Stubs and Transitive Dependencies
- 3.4. Scenarios
- 4. Spring Cloud Contract Verifier Messaging
- 5. Spring Cloud Contract Stub Runner
- 6. Stub Runner for Messaging
- 7. Contract DSL
- 8. Customization
- 9. Using the Pluggable Architecture
- 10. Spring Cloud Contract WireMock
- 11. Migrations
- 12. Links
Spring Cloud Contract Table of Contents
- 1. Spring Cloud Contract
- 2. Spring Cloud Contract Verifier Introduction
- 3. Spring Cloud Contract Verifier Setup
- 3.1. Gradle Project
- 3.1.1. Prerequisites
- 3.1.2. Add Gradle Plugin with Dependencies
- 3.1.3. Gradle and Rest Assured 2.0
- 3.1.4. Snapshot Versions for Gradle
- 3.1.5. Add stubs
- 3.1.6. Run the Plugin
- 3.1.7. Default Setup
- 3.1.8. Configure Plugin
- 3.1.9. Configuration Options
- 3.1.10. Single Base Class for All Tests
- 3.1.11. Different Base Classes for Contracts
- 3.1.12. Invoking Generated Tests
- 3.1.13. Spring Cloud Contract Verifier on the Consumer Side
- 3.2. Maven Project
- 3.2.1. Add maven plugin
- 3.2.2. Maven and Rest Assured 2.0
- 3.2.3. Snapshot versions for Maven
- 3.2.4. Add stubs
- 3.2.5. Run plugin
- 3.2.6. Configure plugin
- 3.2.7. Configuration Options
- 3.2.8. Single Base Class for All Tests
- 3.2.9. Different base classes for contracts
- 3.2.10. Invoking generated tests
- 3.2.11. Maven Plugin and STS
- 3.2.12. Spring Cloud Contract Verifier on the Consumer Side
- 3.3. Stubs and Transitive Dependencies
- 3.4. Scenarios
- 4. Spring Cloud Contract Verifier Messaging
- 5. Spring Cloud Contract Stub Runner
- 6. Stub Runner for Messaging
- 7. Contract DSL
- 8. Customization
- 9. Using the Pluggable Architecture
- 10. Spring Cloud Contract WireMock
- 11. Migrations
- 12. Links