sync() 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
Spring Cloud Contract supports context paths.
![[Important]](images/important.png)
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/1.2.x/single/spring-cloud-contract.html b/1.2.x/single/spring-cloud-contract.html
index f96d33a6f9..10a7e011ce 100644
--- a/1.2.x/single/spring-cloud-contract.html
+++ b/1.2.x/single/spring-cloud-contract.html
@@ -3126,6 +3126,7 @@ the recommended way, as doing so makes the tests ho
regex: bar
response:
status: 200
+ fixedDelayMilliseconds: 1000
headers:
foo2: bar
foo3: foo33
@@ -4259,6 +4260,21 @@ provide a sync() 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
Spring Cloud Contract supports context paths.
![[Important]](images/important.png)
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/1.2.x/spring-cloud-contract.xml b/1.2.x/spring-cloud-contract.xml
index 0d8763a6c6..c0b5cd397b 100644
--- a/1.2.x/spring-cloud-contract.xml
+++ b/1.2.x/spring-cloud-contract.xml
@@ -5357,6 +5357,7 @@ the recommended way, as doing so makes the tests host-in
regex: bar
response:
status: 200
+ fixedDelayMilliseconds: 1000
headers:
foo2: bar
foo3: foo33
@@ -6972,6 +6973,30 @@ provide a sync() method in the response se
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