From daa82d86fcdf770e69c41d0465e27ff271a525ed Mon Sep 17 00:00:00 2001 From: buildmaster Date: Thu, 8 Nov 2018 17:06:51 +0000 Subject: [PATCH] Sync docs from 2.0.x to gh-pages --- ...lti__using_the_pluggable_architecture.html | 4 +-- 2.0.x/multi/multi_contract-dsl.html | 16 ++++++++++++ 2.0.x/single/spring-cloud-contract.html | 20 +++++++++++++-- 2.0.x/spring-cloud-contract.xml | 25 +++++++++++++++++++ 4 files changed, 61 insertions(+), 4 deletions(-) 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 fcceb4079b..c44e2e8074 100644 --- a/2.0.x/multi/multi__using_the_pluggable_architecture.html +++ b/2.0.x/multi/multi__using_the_pluggable_architecture.html @@ -422,7 +422,7 @@ to clone the repository and use it as a source of contracts to generate tests or stubs.

Either via environment variables, system properties, properties set inside the plugin or contracts repository configuration you can tweak the downloader’s behaviour. Below you can find the list of -properties

Table 10.1. SCM Stub Downloader properties

Type of a property

Name of the property

Description

* git.branch (plugin prop) +properties

Table 10.1. SCM Stub Downloader properties

Type of a property

Name of the property

Description

* git.branch (plugin prop)

* stubrunner.properties.git.branch (system prop)

* STUBRUNNER_PROPERTIES_GIT_BRANCH (env prop)

master

Which branch to checkout

* git.username (plugin prop)

* stubrunner.properties.git.username (system prop) @@ -438,7 +438,7 @@ to fetch the Pact contract definitions from the Pact Broker. Whatever is set after pact:// will be parsed as the Pact Broker URL.

Either via environment variables, system properties, properties set inside the plugin or contracts repository configuration you can tweak the downloader’s behaviour. Below you can find the list of -properties

Table 10.2. SCM Stub Downloader properties

Name of a property

Default

Description

* pactbroker.host (plugin prop) +properties

Table 10.2. SCM Stub Downloader properties

Name of a property

Default

Description

* pactbroker.host (plugin prop)

* stubrunner.properties.pactbroker.host (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_HOST (env prop)

Host from URL passed to repositoryRoot

What is the URL of Pact Broker

* pactbroker.port (plugin prop)

* stubrunner.properties.pactbroker.port (system prop) diff --git a/2.0.x/multi/multi_contract-dsl.html b/2.0.x/multi/multi_contract-dsl.html index 1ac73f3cb6..e5ac5e51f6 100644 --- a/2.0.x/multi/multi_contract-dsl.html +++ b/2.0.x/multi/multi_contract-dsl.html @@ -354,6 +354,7 @@ the recommended way, as doing so makes the tests ho regex: bar response: status: 200 + fixedDelayMilliseconds: 1000 headers: foo2: bar foo3: foo33 @@ -1640,6 +1641,21 @@ provide an async() method in the response: async: true

+

You can also use the fixedDelayMilliseconds method / property to add delay to your stubs.

Groovy DSL.  +

org.springframework.cloud.contract.spec.Contract.make {
+    request {
+        method GET()
+        url '/get'
+    }
+    response {
+        status 200
+        body 'Passed'
+        fixedDelayMilliseconds 1000
+    }
+}

+

YAML.  +

response:
+    fixedDelayMilliseconds: 1000

8.8 Working with Context Paths

Spring Cloud Contract supports context paths.

[Important]Important

The only change needed to fully support context paths is the switch on the PRODUCER side. Also, the autogenerated tests must use EXPLICIT mode. The consumer side remains untouched. In order for the generated test to pass, you must use EXPLICIT diff --git a/2.0.x/single/spring-cloud-contract.html b/2.0.x/single/spring-cloud-contract.html index b395326d14..4c7ad5defa 100644 --- a/2.0.x/single/spring-cloud-contract.html +++ b/2.0.x/single/spring-cloud-contract.html @@ -3747,6 +3747,7 @@ the recommended way, as doing so makes the tests ho regex: bar response: status: 200 + fixedDelayMilliseconds: 1000 headers: foo2: bar foo3: foo33 @@ -5033,6 +5034,21 @@ provide an async() method in the response: async: true

+

You can also use the fixedDelayMilliseconds method / property to add delay to your stubs.

Groovy DSL.  +

org.springframework.cloud.contract.spec.Contract.make {
+    request {
+        method GET()
+        url '/get'
+    }
+    response {
+        status 200
+        body 'Passed'
+        fixedDelayMilliseconds 1000
+    }
+}

+

YAML.  +

response:
+    fixedDelayMilliseconds: 1000

8.8 Working with Context Paths

Spring Cloud Contract supports context paths.

[Important]Important

The only change needed to fully support context paths is the switch on the PRODUCER side. Also, the autogenerated tests must use EXPLICIT mode. The consumer side remains untouched. In order for the generated test to pass, you must use EXPLICIT @@ -6055,7 +6071,7 @@ to clone the repository and use it as a source of contracts to generate tests or stubs.

Either via environment variables, system properties, properties set inside the plugin or contracts repository configuration you can tweak the downloader’s behaviour. Below you can find the list of -properties

Table 10.1. SCM Stub Downloader properties

Type of a property

Name of the property

Description

* git.branch (plugin prop) +properties

Table 10.1. SCM Stub Downloader properties

Type of a property

Name of the property

Description

* git.branch (plugin prop)

* stubrunner.properties.git.branch (system prop)

* STUBRUNNER_PROPERTIES_GIT_BRANCH (env prop)

master

Which branch to checkout

* git.username (plugin prop)

* stubrunner.properties.git.username (system prop) @@ -6071,7 +6087,7 @@ to fetch the Pact contract definitions from the Pact Broker. Whatever is set after pact:// will be parsed as the Pact Broker URL.

Either via environment variables, system properties, properties set inside the plugin or contracts repository configuration you can tweak the downloader’s behaviour. Below you can find the list of -properties

Table 10.2. SCM Stub Downloader properties

Name of a property

Default

Description

* pactbroker.host (plugin prop) +properties

Table 10.2. SCM Stub Downloader properties

Name of a property

Default

Description

* pactbroker.host (plugin prop)

* stubrunner.properties.pactbroker.host (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_HOST (env prop)

Host from URL passed to repositoryRoot

What is the URL of Pact Broker

* pactbroker.port (plugin prop)

* stubrunner.properties.pactbroker.port (system prop) diff --git a/2.0.x/spring-cloud-contract.xml b/2.0.x/spring-cloud-contract.xml index 668ec29087..fa11079829 100644 --- a/2.0.x/spring-cloud-contract.xml +++ b/2.0.x/spring-cloud-contract.xml @@ -6349,6 +6349,7 @@ the recommended way, as doing so makes the tests host-in regex: bar response: status: 200 + fixedDelayMilliseconds: 1000 headers: foo2: bar foo3: foo33 @@ -8129,6 +8130,30 @@ provide an async() method in the response async: true +You can also use the fixedDelayMilliseconds method / property to add delay to your stubs. + +Groovy DSL + +org.springframework.cloud.contract.spec.Contract.make { + request { + method GET() + url '/get' + } + response { + status 200 + body 'Passed' + fixedDelayMilliseconds 1000 + } +} + + + +YAML + +response: + fixedDelayMilliseconds: 1000 + +

Working with Context Paths