Sync docs from master to gh-pages
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1712,8 +1712,34 @@ socket.</p><p>Consider the following contract:</p><pre class="programlisting">or
|
||||
}
|
||||
}</pre><p>If you do it this way:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">All of your requests in the autogenerated tests are sent to the real endpoint with your
|
||||
context path included (for example, <code class="literal">/my-context-path/url</code>).</li><li class="listitem">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 <code class="literal">/my-context-path/url</code>).</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_working_with_web_flux" href="#_working_with_web_flux"></a>8.9 Working with Web Flux</h2></div></div></div><p>Spring Cloud Contract requires the usage of <code class="literal">EXPLICIT</code> mode in your generated tests
|
||||
to work with Web Flux.</p><p class="primary"><b>Maven. </b>
|
||||
that information (for example, in the stubs, you have to call <code class="literal">/my-context-path/url</code>).</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_working_with_webflux" href="#_working_with_webflux"></a>8.9 Working with WebFlux</h2></div></div></div><p>Spring Cloud Contract offers two ways of working with WebFlux.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_webflux_with_webtestclient" href="#_webflux_with_webtestclient"></a>8.9.1 WebFlux with WebTestClient</h3></div></div></div><p>One of them is via the <code class="literal">WebTestClient</code> mode.</p><p class="primary"><b>Maven. </b>
|
||||
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><plugin></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><groupId></span>org.springframework.cloud<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></groupId></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><artifactId></span>spring-cloud-contract-maven-plugin<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></artifactId></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><version></span>${spring-cloud-contract.version}<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></version></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><extensions></span>true<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></extensions></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><configuration></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><testMode></span>WEBTESTCLIENT<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></testMode></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></configuration></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></plugin></span></pre><p class="primary">
|
||||
</p><p class="secondary"><b>Gradle. </b>
|
||||
</p><pre class="programlisting">contracts {
|
||||
testMode = <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">'WEBTESTCLIENT'</span>
|
||||
}</pre><p class="secondary">
|
||||
</p><p>The following example shows how to set up a <code class="literal">WebTestClient</code> base class and <code class="literal">RestAssured</code>
|
||||
for WebFlux:</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">import</span> io.restassured.module.webtestclient.RestAssuredWebTestClient;
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">import</span> org.junit.Before;
|
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">abstract</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> BeerRestBase {
|
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Before</span></em>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">void</span> setup() {
|
||||
RestAssuredWebTestClient.standaloneSetup(
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> ProducerController(personToCheck -> personToCheck.age >= <span class="hl-number">20</span>));
|
||||
}
|
||||
}
|
||||
}</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_webflux_with_explicit_mode" href="#_webflux_with_explicit_mode"></a>8.9.2 WebFlux with Explicit mode</h3></div></div></div><p>Another way is with the <code class="literal">EXPLICIT</code> mode in your generated tests
|
||||
to work with WebFlux.</p><p class="primary"><b>Maven. </b>
|
||||
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><plugin></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><groupId></span>org.springframework.cloud<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></groupId></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><artifactId></span>spring-cloud-contract-maven-plugin<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></artifactId></span>
|
||||
@@ -1751,7 +1777,7 @@ to work with Web Flux.</p><p class="primary"><b>Maven. </b>
|
||||
}
|
||||
}
|
||||
|
||||
}</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_xml_support_for_rest" href="#_xml_support_for_rest"></a>8.10 XML Support for REST</h2></div></div></div><p>For REST contracts, we also support XML request and response body.
|
||||
}</pre></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_xml_support_for_rest" href="#_xml_support_for_rest"></a>8.10 XML Support for REST</h2></div></div></div><p>For REST contracts, we also support XML request and response body.
|
||||
The XML body has to be passed within the <code class="literal">body</code> element
|
||||
as a <code class="literal">String</code> or <code class="literal">GString</code>. Also body matchers can be provided for
|
||||
both request and response. In place of the <code class="literal">jsonPath(…​)</code> method, the <code class="literal">org.springframework.cloud.contract.spec.internal.BodyMatchers.xPath</code>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -348,12 +348,12 @@
|
||||
<td><a href="#org.springframework.cloud.contract.maven.verifier.stubrunner.LocalStubRunner.java">org/springframework/cloud/contract/maven/verifier/stubrunner/LocalStubRunner.java</a></td>
|
||||
<td>0</td>
|
||||
<td>0</td>
|
||||
<td>9</td></tr>
|
||||
<td>10</td></tr>
|
||||
<tr class="a">
|
||||
<td><a href="#org.springframework.cloud.contract.maven.verifier.stubrunner.RemoteStubRunner.java">org/springframework/cloud/contract/maven/verifier/stubrunner/RemoteStubRunner.java</a></td>
|
||||
<td>0</td>
|
||||
<td>0</td>
|
||||
<td>20</td></tr></table></div>
|
||||
<td>19</td></tr></table></div>
|
||||
<div class="section">
|
||||
<h2><a name="Rules"></a>Rules</h2>
|
||||
<table border="0" class="table table-striped">
|
||||
@@ -3884,52 +3884,58 @@
|
||||
<tr class="a">
|
||||
<td><img src="images/icon_error_sml.gif" alt="" /> Error</td>
|
||||
<td>javadoc</td>
|
||||
<td>JavadocPackage</td>
|
||||
<td>Missing package-info.java file.</td>
|
||||
<td></td></tr>
|
||||
<tr class="b">
|
||||
<td><img src="images/icon_error_sml.gif" alt="" /> Error</td>
|
||||
<td>javadoc</td>
|
||||
<td>JavadocType</td>
|
||||
<td>Missing a Javadoc comment.</td>
|
||||
<td>26</td></tr>
|
||||
<tr class="b">
|
||||
<tr class="a">
|
||||
<td><img src="images/icon_error_sml.gif" alt="" /> Error</td>
|
||||
<td>whitespace</td>
|
||||
<td>FileTabCharacter</td>
|
||||
<td>File contains tab characters (this is the first instance).</td>
|
||||
<td>29</td></tr>
|
||||
<tr class="a">
|
||||
<tr class="b">
|
||||
<td><img src="images/icon_error_sml.gif" alt="" /> Error</td>
|
||||
<td>javadoc</td>
|
||||
<td>JavadocVariable</td>
|
||||
<td>Missing a Javadoc comment.</td>
|
||||
<td>29</td></tr>
|
||||
<tr class="b">
|
||||
<tr class="a">
|
||||
<td><img src="images/icon_error_sml.gif" alt="" /> Error</td>
|
||||
<td>naming</td>
|
||||
<td>ConstantName</td>
|
||||
<td>Name 'log' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.</td>
|
||||
<td>29</td></tr>
|
||||
<tr class="a">
|
||||
<tr class="b">
|
||||
<td><img src="images/icon_error_sml.gif" alt="" /> Error</td>
|
||||
<td>sizes</td>
|
||||
<td>LineLength</td>
|
||||
<td>Line is longer than 80 characters (found 85).</td>
|
||||
<td>31</td></tr>
|
||||
<tr class="b">
|
||||
<tr class="a">
|
||||
<td><img src="images/icon_error_sml.gif" alt="" /> Error</td>
|
||||
<td>design</td>
|
||||
<td>DesignForExtension</td>
|
||||
<td>Class 'LocalStubRunner' looks like designed for extension (can be subclassed), but the method 'run' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'LocalStubRunner' final or making the method 'run' static/final/abstract/empty, or adding allowed annotation for the method.</td>
|
||||
<td>31</td></tr>
|
||||
<tr class="a">
|
||||
<tr class="b">
|
||||
<td><img src="images/icon_error_sml.gif" alt="" /> Error</td>
|
||||
<td>javadoc</td>
|
||||
<td>JavadocMethod</td>
|
||||
<td>Missing a Javadoc comment.</td>
|
||||
<td>31</td></tr>
|
||||
<tr class="b">
|
||||
<tr class="a">
|
||||
<td><img src="images/icon_error_sml.gif" alt="" /> Error</td>
|
||||
<td>misc</td>
|
||||
<td>FinalParameters</td>
|
||||
<td>Parameter options should be final.</td>
|
||||
<td>31</td></tr>
|
||||
<tr class="a">
|
||||
<tr class="b">
|
||||
<td><img src="images/icon_error_sml.gif" alt="" /> Error</td>
|
||||
<td>sizes</td>
|
||||
<td>LineLength</td>
|
||||
@@ -3938,18 +3944,12 @@
|
||||
<div class="section">
|
||||
<h3 id="org.springframework.cloud.contract.maven.verifier.stubrunner.RemoteStubRunner.java">org/springframework/cloud/contract/maven/verifier/stubrunner/RemoteStubRunner.java</h3>
|
||||
<table border="0" class="table table-striped">
|
||||
<tr class="b">
|
||||
<tr class="a">
|
||||
<th>Severity</th>
|
||||
<th>Category</th>
|
||||
<th>Rule</th>
|
||||
<th>Message</th>
|
||||
<th>Line</th></tr>
|
||||
<tr class="a">
|
||||
<td><img src="images/icon_error_sml.gif" alt="" /> Error</td>
|
||||
<td>javadoc</td>
|
||||
<td>JavadocPackage</td>
|
||||
<td>Missing package-info.java file.</td>
|
||||
<td></td></tr>
|
||||
<tr class="b">
|
||||
<td><img src="images/icon_error_sml.gif" alt="" /> Error</td>
|
||||
<td>javadoc</td>
|
||||
|
||||
@@ -130,7 +130,7 @@ under the License.
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://github.com/spring-cloud/spring-cloud-contract/checkstyle.html#org.springframework.cloud.contract.maven.verifier.stubrunner.RemoteStubRunner.java">org/springframework/cloud/contract/maven/verifier/stubrunner/RemoteStubRunner.java</a>
|
||||
<a href="https://github.com/spring-cloud/spring-cloud-contract/checkstyle.html#org.springframework.cloud.contract.maven.verifier.RunMojo.java">org/springframework/cloud/contract/maven/verifier/RunMojo.java</a>
|
||||
</td>
|
||||
<td>
|
||||
0
|
||||
@@ -139,7 +139,7 @@ under the License.
|
||||
0
|
||||
</td>
|
||||
<td>
|
||||
20
|
||||
46
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -158,7 +158,7 @@ under the License.
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://github.com/spring-cloud/spring-cloud-contract/checkstyle.html#org.springframework.cloud.contract.maven.verifier.RunMojo.java">org/springframework/cloud/contract/maven/verifier/RunMojo.java</a>
|
||||
<a href="https://github.com/spring-cloud/spring-cloud-contract/checkstyle.html#org.springframework.cloud.contract.maven.verifier.stubrunner.RemoteStubRunner.java">org/springframework/cloud/contract/maven/verifier/stubrunner/RemoteStubRunner.java</a>
|
||||
</td>
|
||||
<td>
|
||||
0
|
||||
@@ -167,7 +167,7 @@ under the License.
|
||||
0
|
||||
</td>
|
||||
<td>
|
||||
46
|
||||
19
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -181,7 +181,7 @@ under the License.
|
||||
0
|
||||
</td>
|
||||
<td>
|
||||
9
|
||||
10
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<book xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en">
|
||||
<info>
|
||||
<title>Spring Cloud Contract</title>
|
||||
<date>2019-01-18</date>
|
||||
<date>2019-01-21</date>
|
||||
</info>
|
||||
<preface>
|
||||
<title></title>
|
||||
@@ -8630,10 +8630,53 @@ that information (for example, in the stubs, you have to call <literal>/my-conte
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section xml:id="_working_with_web_flux">
|
||||
<title>Working with Web Flux</title>
|
||||
<simpara>Spring Cloud Contract requires the usage of <literal>EXPLICIT</literal> mode in your generated tests
|
||||
to work with Web Flux.</simpara>
|
||||
<section xml:id="_working_with_webflux">
|
||||
<title>Working with WebFlux</title>
|
||||
<simpara>Spring Cloud Contract offers two ways of working with WebFlux.</simpara>
|
||||
<section xml:id="_webflux_with_webtestclient">
|
||||
<title>WebFlux with WebTestClient</title>
|
||||
<simpara>One of them is via the <literal>WebTestClient</literal> mode.</simpara>
|
||||
<formalpara role="primary">
|
||||
<title>Maven</title>
|
||||
<para>
|
||||
<programlisting language="xml" linenumbering="unnumbered"><plugin>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
|
||||
<version>${spring-cloud-contract.version}</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<testMode>WEBTESTCLIENT</testMode>
|
||||
</configuration>
|
||||
</plugin></programlisting>
|
||||
</para>
|
||||
</formalpara>
|
||||
<formalpara role="secondary">
|
||||
<title>Gradle</title>
|
||||
<para>
|
||||
<programlisting language="groovy" linenumbering="unnumbered">contracts {
|
||||
testMode = 'WEBTESTCLIENT'
|
||||
}</programlisting>
|
||||
</para>
|
||||
</formalpara>
|
||||
<simpara>The following example shows how to set up a <literal>WebTestClient</literal> base class and <literal>RestAssured</literal>
|
||||
for WebFlux:</simpara>
|
||||
<programlisting language="groovy" linenumbering="unnumbered">import io.restassured.module.webtestclient.RestAssuredWebTestClient;
|
||||
import org.junit.Before;
|
||||
|
||||
public abstract class BeerRestBase {
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
RestAssuredWebTestClient.standaloneSetup(
|
||||
new ProducerController(personToCheck -> personToCheck.age >= 20));
|
||||
}
|
||||
}
|
||||
}</programlisting>
|
||||
</section>
|
||||
<section xml:id="_webflux_with_explicit_mode">
|
||||
<title>WebFlux with Explicit mode</title>
|
||||
<simpara>Another way is with the <literal>EXPLICIT</literal> mode in your generated tests
|
||||
to work with WebFlux.</simpara>
|
||||
<formalpara role="primary">
|
||||
<title>Maven</title>
|
||||
<para>
|
||||
@@ -8683,6 +8726,7 @@ static class Config {
|
||||
|
||||
}</programlisting>
|
||||
</section>
|
||||
</section>
|
||||
<section xml:id="_xml_support_for_rest">
|
||||
<title>XML Support for REST</title>
|
||||
<simpara>For REST contracts, we also support XML request and response body.
|
||||
|
||||
Reference in New Issue
Block a user