From cb5d1a146519b13719f3196a06a437a853a12d78 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Tue, 17 Jul 2018 12:43:04 +0200 Subject: [PATCH] Added documentation on how to set up webflux; fixes gh-688 --- docs/src/main/asciidoc/verifier_contract.adoc | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/docs/src/main/asciidoc/verifier_contract.adoc b/docs/src/main/asciidoc/verifier_contract.adoc index a780dce0f3..8301317b46 100644 --- a/docs/src/main/asciidoc/verifier_contract.adoc +++ b/docs/src/main/asciidoc/verifier_contract.adoc @@ -1103,6 +1103,47 @@ context path included (for example, `/my-context-path/url`). * Your contracts reflect that you have a context path. Your generated stubs also have that information (for example, in the stubs, you have to call `/my-context-path/url`). +=== Working with Web Flux + +Spring Cloud Contract requires the usage of `EXPLICIT` mode in your generated tests +to work with Web Flux. + +[source,xml,indent=0,subs="verbatim,attributes",role="primary"] +.Maven +---- + + org.springframework.cloud + spring-cloud-contract-maven-plugin + ${spring-cloud-contract.version} + true + + EXPLICIT + + +---- + +[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"] +.Gradle +---- +contracts { + testMode = 'EXPLICIT' +} +---- + +The following example shows how to set up a base class and Rest Assured for Web Flux: + +[source,groovy,indent=0] +---- +include::{samples_url}/producer_webflux/src/test/java/com/example/BeerRestBase.java[tags=annotations,indent=0] + + // your tests go here + + // in this config class you define all controllers and mocked services + include::{samples_url}/producer_webflux/src/test/java/com/example/BeerRestBase.java[tags=config,indent=0] + +} +---- + === Messaging Top-Level Elements The DSL for messaging looks a little bit different than the one that focuses on HTTP. The