org.springframework.cloud.contract.spec.Contract.make {
+ request {
+ method 'GET'
+ url '/get'
+ }
+ response {
+ status 200
+ body 'Passed'
+ async()
+ }
+}
+diff --git a/spring-cloud-contract-maven-plugin/complex-content.html b/spring-cloud-contract-maven-plugin/complex-content.html index cb66e2557c..63b0014d28 100644 --- a/spring-cloud-contract-maven-plugin/complex-content.html +++ b/spring-cloud-contract-maven-plugin/complex-content.html @@ -1,13 +1,13 @@
- +If you’re using asynchronous communication on the server side (your controllers are returning
+Callable, DeferredResult etc. then inside your contract you have to provide in the response
+section a async() method. Example:
org.springframework.cloud.contract.spec.Contract.make {
+ request {
+ method 'GET'
+ url '/get'
+ }
+ response {
+ status 200
+ body 'Passed'
+ async()
+ }
+}
+The DSL for messaging looks a little bit different than the one that focuses on HTTP.