From b9eee2b2a7b2902154c5378872d3bed4b0c543f3 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Tue, 20 Sep 2016 12:33:55 +0200 Subject: [PATCH] Added docs about async fixes #80 --- docs/src/main/asciidoc/verifier/contract.adoc | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/src/main/asciidoc/verifier/contract.adoc b/docs/src/main/asciidoc/verifier/contract.adoc index 95546a6602..8f8c00d2af 100644 --- a/docs/src/main/asciidoc/verifier/contract.adoc +++ b/docs/src/main/asciidoc/verifier/contract.adoc @@ -233,6 +233,30 @@ Example of a test API generated: include::{verifier_core_path}/src/test/groovy/org/springframework/cloud/contract/verifier/builder/JaxRsClientMethodBuilderSpec.groovy[tags=jaxrs,indent=0] ---- +==== Async support + +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: + +[source,groovy,indent=0] +---- +org.springframework.cloud.contract.spec.Contract.make { + request { + method 'GET' + url '/get' + } + response { + status 200 + body 'Passed' + async() + } +} +---- + + + + ==== Messaging Top-Level Elements The DSL for messaging looks a little bit different than the one that focuses on HTTP.