Sync docs from 1.2.x to gh-pages
BIN
1.2.x/images/callouts/1.png
Normal file
|
After Width: | Height: | Size: 329 B |
BIN
1.2.x/images/callouts/2.png
Normal file
|
After Width: | Height: | Size: 353 B |
BIN
1.2.x/images/callouts/3.png
Normal file
|
After Width: | Height: | Size: 350 B |
BIN
1.2.x/multi/images/callouts/1.png
Normal file
|
After Width: | Height: | Size: 329 B |
BIN
1.2.x/multi/images/callouts/2.png
Normal file
|
After Width: | Height: | Size: 353 B |
BIN
1.2.x/multi/images/callouts/3.png
Normal file
|
After Width: | Height: | Size: 350 B |
@@ -115,15 +115,15 @@ one to one to the contents of the repo.</p><p>Example of a <code class="literal"
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><parent></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><groupId></span>org.springframework.boot<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-boot-starter-parent<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>2.0.0.BUILD-SNAPSHOT<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></version></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><version></span>1.5.10.RELEASE<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></version></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><relativePath /></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></parent></span>
|
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><properties></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><project.build.sourceEncoding></span>UTF-8<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></project.build.sourceEncoding></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><java.version></span>1.8<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></java.version></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><spring-cloud-contract.version></span>2.0.0.BUILD-SNAPSHOT<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></spring-cloud-contract.version></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><spring-cloud-dependencies.version></span>Finchley.BUILD-SNAPSHOT<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></spring-cloud-dependencies.version></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><spring-cloud-contract.version></span>1.2.4.BUILD-SNAPSHOT<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></spring-cloud-contract.version></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><spring-cloud-dependencies.version></span>Edgware.BUILD-SNAPSHOT<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></spring-cloud-dependencies.version></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><excludeBuildFolders></span>true<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></excludeBuildFolders></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></properties></span>
|
||||
|
||||
@@ -280,7 +280,6 @@ of the JAR containing the contracts:</p><pre class="programlisting"><span xmlns:
|
||||
<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"><configuration></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><stubsMode></span>REMOTE<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></stubsMode></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><contractsRepositoryUrl></span>http://link/to/your/nexus/or/artifactory/or/sth<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></contractsRepositoryUrl></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><contractDependency></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><groupId></span>com.example.standalone<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></groupId></span>
|
||||
|
||||
@@ -489,10 +489,12 @@ You can disable Stub Runner Ribbon support by providing: <code class="literal">s
|
||||
You can disable Stub Runner support by providing: <code class="literal">stubrunner.cloud.enabled</code> equal to <code class="literal">false</code></p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td><th align="left">Tip</th></tr><tr><td align="left" valign="top"><p>By default all service discovery will be stubbed. That means that regardless of the fact if you have
|
||||
an existing <code class="literal">DiscoveryClient</code> its results will be ignored. However, if you want to reuse it, just set
|
||||
<code class="literal">stubrunner.cloud.delegate.enabled</code> to <code class="literal">true</code> and then your existing <code class="literal">DiscoveryClient</code> results will be
|
||||
merged with the stubbed ones.</p></td></tr></table></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_stub_runner_boot_application" href="#_stub_runner_boot_application"></a>6.6 Stub Runner Boot Application</h2></div></div></div><p>Spring Cloud Contract Stub Runner Boot is a Spring Boot application that exposes REST endpoints to
|
||||
merged with the stubbed ones.</p></td></tr></table></div><p>The default Maven configuration used by Stub Runner can be tweaked either
|
||||
via the following system properties or environment variables</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">maven.repo.local</code> - path to the custom maven local repository location</li><li class="listitem"><code class="literal">org.apache.maven.user-settings</code> - path to custom maven user settings location</li><li class="listitem"><code class="literal">org.apache.maven.global-settings</code> - path to maven global settings location</li></ul></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_stub_runner_boot_application" href="#_stub_runner_boot_application"></a>6.6 Stub Runner Boot Application</h2></div></div></div><p>Spring Cloud Contract Stub Runner Boot is a Spring Boot application that exposes REST endpoints to
|
||||
trigger the messaging labels and to access started WireMock servers.</p><p>One of the use-cases is to run some smoke (end to end) tests on a deployed application.
|
||||
You can check out the <a class="link" href="https://github.com/spring-cloud/spring-cloud-pipelines" target="_top">Spring Cloud Pipelines</a>
|
||||
project for more information.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_how_to_use_it" href="#_how_to_use_it"></a>6.6.1 How to use it?</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_stub_runner_server" href="#_stub_runner_server"></a>Stub Runner Server</h4></div></div></div><p>Just add the</p><pre class="programlisting">compile <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"org.springframework.cloud:spring-cloud-starter-stub-runner"</span></pre><p>Annotate a class with <code class="literal">@EnableStubRunnerServer</code>, build a fat-jar and you’re ready to go!</p><p>For the properties check the <span class="strong"><strong>Stub Runner Spring</strong></span> section.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_spring_cloud_cli" href="#_spring_cloud_cli"></a>Spring Cloud CLI</h4></div></div></div><p>Starting from <code class="literal">1.4.0.RELEASE</code> version of the <a class="link" href="http://cloud.spring.io/spring-cloud-cli" target="_top">Spring Cloud CLI</a>
|
||||
project for more information.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_how_to_use_it" href="#_how_to_use_it"></a>6.6.1 How to use it?</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_stub_runner_server" href="#_stub_runner_server"></a>Stub Runner Server</h4></div></div></div><p>Just add the</p><pre class="programlisting">compile <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"org.springframework.cloud:spring-cloud-starter-stub-runner"</span></pre><p>Annotate a class with <code class="literal">@EnableStubRunnerServer</code>, build a fat-jar and you’re ready to go!</p><p>For the properties check the <span class="strong"><strong>Stub Runner Spring</strong></span> section.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_stub_runner_server_fat_jar" href="#_stub_runner_server_fat_jar"></a>Stub Runner Server Fat Jar</h4></div></div></div><p>You can download a standalone JAR from Maven (for example, for version 1.2.3.RELEASE), as follows:</p><pre class="programlisting">$ wget -O stub-runner.jar <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">'https://search.maven.org/remote_content?g=org.springframework.cloud&a=spring-cloud-contract-stub-runner-boot&v=1.2.3.RELEASE'</span>
|
||||
$ java -jar stub-runner.jar --stubrunner.ids=... --stubrunner.repositoryRoot=...</pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_spring_cloud_cli" href="#_spring_cloud_cli"></a>Spring Cloud CLI</h4></div></div></div><p>Starting from <code class="literal">1.4.0.RELEASE</code> version of the <a class="link" href="http://cloud.spring.io/spring-cloud-cli" target="_top">Spring Cloud CLI</a>
|
||||
project you can start Stub Runner Boot by executing <code class="literal">spring cloud stubrunner</code>.</p><p>In order to pass the configuration just create a <code class="literal">stubrunner.yml</code> file in the current working directory
|
||||
or a subdirectory called <code class="literal">config</code> or in <code class="literal">~/.spring-cloud</code>. The file could look like this
|
||||
(example for running stubs installed locally)</p><p><b>stubrunner.yml. </b>
|
||||
@@ -687,12 +689,12 @@ would like the Stub Runner to take into consideration. You can read more about t
|
||||
<a class="link" href="https://wiki.eclipse.org/Aether/New_and_Noteworthy#Version_Ranges" target="_top">Aether versioning
|
||||
ranges here</a>.</p></td></tr></table></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="stubrunner-docker" href="#stubrunner-docker"></a>6.9 Stub Runner Docker</h2></div></div></div><p>We’re publishing a <code class="literal">spring-cloud/spring-cloud-contract-stub-runner</code> Docker image
|
||||
that will start the standalone version of Stub Runner.</p><p>If you want to learn more about the basics of Maven, artifact ids,
|
||||
group ids, classifiers and Artifact Managers, just click here <a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#docker-project" title="4.5 Docker Project">Section 4.5, “Docker Project”</a>.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_how_to_use_it_2" href="#_how_to_use_it_2"></a>6.9.1 How to use it</h3></div></div></div><p>Just execute the docker image. You can pass any of the <a class="xref" href="multi__spring_cloud_contract_stub_runner.html#common-properties-junit-spring" title="6.8.1 Common Properties for JUnit and Spring">Section 6.8.1, “Common Properties for JUnit and Spring”</a>
|
||||
group ids, classifiers and Artifact Managers, just click here <a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#docker-project" title="4.6 Docker Project">Section 4.6, “Docker Project”</a>.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_how_to_use_it_2" href="#_how_to_use_it_2"></a>6.9.1 How to use it</h3></div></div></div><p>Just execute the docker image. You can pass any of the <a class="xref" href="multi__spring_cloud_contract_stub_runner.html#common-properties-junit-spring" title="6.8.1 Common Properties for JUnit and Spring">Section 6.8.1, “Common Properties for JUnit and Spring”</a>
|
||||
as environment variables. The convention is that all the
|
||||
letters should be upper case. The camel case notation should
|
||||
and the dot (<code class="literal">.</code>) should be separated via underscore (<code class="literal">_</code>). E.g.
|
||||
the <code class="literal">stubrunner.repositoryRoot</code> property should be represented
|
||||
as a <code class="literal">STUBRUNNER_REPOSITORY_ROOT</code> environment variable.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_example_of_client_side_usage_in_a_non_jvm_project" href="#_example_of_client_side_usage_in_a_non_jvm_project"></a>6.9.2 Example of client side usage in a non JVM project</h3></div></div></div><p>We’d like to use the stubs created in this <a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#docker-server-side" title="4.5.4 Server side (nodejs)">Section 4.5.4, “Server side (nodejs)”</a> step.
|
||||
as a <code class="literal">STUBRUNNER_REPOSITORY_ROOT</code> environment variable.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_example_of_client_side_usage_in_a_non_jvm_project" href="#_example_of_client_side_usage_in_a_non_jvm_project"></a>6.9.2 Example of client side usage in a non JVM project</h3></div></div></div><p>We’d like to use the stubs created in this <a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#docker-server-side" title="4.6.4 Server side (nodejs)">Section 4.6.4, “Server side (nodejs)”</a> step.
|
||||
Let’s assume that we want to run the stubs on port <code class="literal">9876</code>. The NodeJS code
|
||||
is available here:</p><pre class="programlisting">$ git clone https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs
|
||||
$ <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">cd</span> bookstore</pre><p>Let’s run the Stub Runner Boot application with the stubs.</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># Provide the Spring Cloud Contract Docker version</span>
|
||||
|
||||
@@ -9,14 +9,14 @@ produced by Spring Cloud Contract Verifier.</li><li class="listitem">Messaging r
|
||||
Integration, Spring Cloud Stream, Spring AMQP, and Apache Camel. You can also set your
|
||||
own integrations.</li><li class="listitem">Acceptance tests (in JUnit or Spock) are used to verify if server-side implementation
|
||||
of the API is compliant with the contract (<span class="emphasis"><em>server tests</em></span>). A full test is generated by
|
||||
Spring Cloud Contract Verifier.</li></ul></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_why_a_contract_verifier" href="#_why_a_contract_verifier"></a>2.1 Why a Contract Verifier?</h2></div></div></div><p>Assume that we have a system consisting of multiple microservices:</p><div class="informalfigure"><div class="mediaobject"><img src="https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/master/docs/src/main/asciidoc/images/Deps.png" alt="Microservices Architecture"></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_testing_issues" href="#_testing_issues"></a>2.1.1 Testing issues</h3></div></div></div><p>If we wanted to test the application in top left corner to determine whether it can
|
||||
Spring Cloud Contract Verifier.</li></ul></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_why_a_contract_verifier" href="#_why_a_contract_verifier"></a>2.1 Why a Contract Verifier?</h2></div></div></div><p>Assume that we have a system consisting of multiple microservices:</p><div class="informalfigure"><div class="mediaobject"><img src="https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/1.2.x/docs/src/main/asciidoc/images/Deps.png" alt="Microservices Architecture"></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_testing_issues" href="#_testing_issues"></a>2.1.1 Testing issues</h3></div></div></div><p>If we wanted to test the application in top left corner to determine whether it can
|
||||
communicate with other services, we could do one of two things:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">Deploy all microservices and perform end-to-end tests.</li><li class="listitem">Mock other microservices in unit/integration tests.</li></ul></div><p>Both have their advantages but also a lot of disadvantages.</p><p><span class="strong"><strong>Deploy all microservices and perform end to end tests</strong></span></p><p>Advantages:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">Simulates production.</li><li class="listitem">Tests real communication between services.</li></ul></div><p>Disadvantages:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">To test one microservice, we have to deploy 6 microservices, a couple of databases,
|
||||
etc.</li><li class="listitem">The environment where the tests run is locked for a single suite of tests (nobody else
|
||||
would be able to run the tests in the meantime).</li><li class="listitem">They take a long time to run.</li><li class="listitem">The feedback comes very late in the process.</li><li class="listitem">They are extremely hard to debug.</li></ul></div><p><span class="strong"><strong>Mock other microservices in unit/integration tests</strong></span></p><p>Advantages:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">They provide very fast feedback.</li><li class="listitem">They have no infrastructure requirements.</li></ul></div><p>Disadvantages:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">The implementor of the service creates stubs that might have nothing to do with
|
||||
reality.</li><li class="listitem">You can go to production with passing tests and failing production.</li></ul></div><p>To solve the aforementioned issues, Spring Cloud Contract Verifier with Stub Runner was
|
||||
created. The main idea is to give you very fast feedback, without the need to set up the
|
||||
whole world of microservices. If you work on stubs, then the only applications you need
|
||||
are those that your application directly uses.</p><div class="informalfigure"><div class="mediaobject"><img src="https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/master/docs/src/main/asciidoc/images/Stubs2.png" alt="Stubbed Services"></div></div><p>Spring Cloud Contract Verifier gives you the certainty that the stubs that you use were
|
||||
are those that your application directly uses.</p><div class="informalfigure"><div class="mediaobject"><img src="https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/1.2.x/docs/src/main/asciidoc/images/Stubs2.png" alt="Stubbed Services"></div></div><p>Spring Cloud Contract Verifier gives you the certainty that the stubs that you use were
|
||||
created by the service that you’re calling. Also, if you can use them, it means that they
|
||||
were tested against the producer’s side. In short, you can trust those stubs.</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_purposes" href="#_purposes"></a>2.2 Purposes</h2></div></div></div><p>The main purposes of Spring Cloud Contract Verifier with Stub Runner are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">To ensure that WireMock/Messaging stubs (used when developing the client) do exactly
|
||||
what the actual server-side implementation does.</li><li class="listitem">To promote ATDD method and Microservices architectural style.</li><li class="listitem">To provide a way to publish changes in contracts that are immediately visible on both
|
||||
@@ -176,8 +176,8 @@ us. The current implementation of our system grants loans to everybody.</p><p>As
|
||||
sprint, we must develop a new feature: if a client wants to borrow too much money, then
|
||||
we mark the client as a fraud.</p><p>Technical remark - Fraud Detection has an <code class="literal">artifact-id</code> of <code class="literal">http-server</code>, while Loan
|
||||
Issuance has an artifact-id of <code class="literal">http-client</code>, and both have a <code class="literal">group-id</code> of <code class="literal">com.example</code>.</p><p>Social remark - both client and server development teams need to communicate directly and
|
||||
discuss changes while going through the process. CDC is all about communication.</p><p>The <a class="link" href="https://github.com/spring-cloud/spring-cloud-contract/tree/master/samples/standalone/dsl/http-server" target="_top">server
|
||||
side code is available here</a> and <a class="link" href="https://github.com/spring-cloud/spring-cloud-contract/tree/master/samples/standalone/dsl/http-client" target="_top">the
|
||||
discuss changes while going through the process. CDC is all about communication.</p><p>The <a class="link" href="https://github.com/spring-cloud/spring-cloud-contract/tree/1.2.x/samples/standalone/dsl/http-server" target="_top">server
|
||||
side code is available here</a> and <a class="link" href="https://github.com/spring-cloud/spring-cloud-contract/tree/1.2.x/samples/standalone/dsl/http-client" target="_top">the
|
||||
client code here</a>.</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td><th align="left">Tip</th></tr><tr><td align="left" valign="top"><p>In this case, the producer owns the contracts. Physically, all the contract are
|
||||
in the producer’s repository.</p></td></tr></table></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_technical_note" href="#_technical_note"></a>2.4.1 Technical note</h3></div></div></div><p>If using the <span class="strong"><strong>SNAPSHOT</strong></span> / <span class="strong"><strong>Milestone</strong></span> / <span class="strong"><strong>Release Candidate</strong></span> versions please add the
|
||||
following section to your build:</p><p class="primary"><b>Maven. </b>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>4. Spring Cloud Contract Verifier Setup</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-contract.html" title="Spring Cloud Contract"><link rel="up" href="multi_spring-cloud-contract.html" title="Spring Cloud Contract"><link rel="prev" href="multi__spring_cloud_contract_faq.html" title="3. Spring Cloud Contract FAQ"><link rel="next" href="multi__spring_cloud_contract_verifier_messaging.html" title="5. Spring Cloud Contract Verifier Messaging"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4. Spring Cloud Contract Verifier Setup</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__spring_cloud_contract_faq.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__spring_cloud_contract_verifier_messaging.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_spring_cloud_contract_verifier_setup" href="#_spring_cloud_contract_verifier_setup"></a>4. Spring Cloud Contract Verifier Setup</h1></div></div></div><p>You can set up Spring Cloud Contract Verifier in the following ways:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><a class="link" href="multi__spring_cloud_contract_verifier_setup.html#gradle-project" title="4.1 Gradle Project">As a Gradle project</a></li><li class="listitem"><a class="link" href="multi__spring_cloud_contract_verifier_setup.html#maven-project" title="4.2 Maven Project">As a Maven project</a></li><li class="listitem"><a class="link" href="multi__spring_cloud_contract_verifier_setup.html#docker-project" title="4.5 Docker Project">As a Docker project</a></li></ul></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="gradle-project" href="#gradle-project"></a>4.1 Gradle Project</h2></div></div></div><p>To learn how to set up the Gradle project for Spring Cloud Contract Verifier, read the
|
||||
<title>4. Spring Cloud Contract Verifier Setup</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-contract.html" title="Spring Cloud Contract"><link rel="up" href="multi_spring-cloud-contract.html" title="Spring Cloud Contract"><link rel="prev" href="multi__spring_cloud_contract_faq.html" title="3. Spring Cloud Contract FAQ"><link rel="next" href="multi__spring_cloud_contract_verifier_messaging.html" title="5. Spring Cloud Contract Verifier Messaging"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4. Spring Cloud Contract Verifier Setup</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__spring_cloud_contract_faq.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__spring_cloud_contract_verifier_messaging.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_spring_cloud_contract_verifier_setup" href="#_spring_cloud_contract_verifier_setup"></a>4. Spring Cloud Contract Verifier Setup</h1></div></div></div><p>You can set up Spring Cloud Contract Verifier in the following ways:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><a class="link" href="multi__spring_cloud_contract_verifier_setup.html#gradle-project" title="4.1 Gradle Project">As a Gradle project</a></li><li class="listitem"><a class="link" href="multi__spring_cloud_contract_verifier_setup.html#maven-project" title="4.2 Maven Project">As a Maven project</a></li><li class="listitem"><a class="link" href="multi__spring_cloud_contract_verifier_setup.html#docker-project" title="4.6 Docker Project">As a Docker project</a></li></ul></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="gradle-project" href="#gradle-project"></a>4.1 Gradle Project</h2></div></div></div><p>To learn how to set up the Gradle project for Spring Cloud Contract Verifier, read the
|
||||
following sections:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#gradle-prerequisites" title="4.1.1 Prerequisites">Section 4.1.1, “Prerequisites”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#gradle-add-gradle-plugin" title="4.1.2 Add Gradle Plugin with Dependencies">Section 4.1.2, “Add Gradle Plugin with Dependencies”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#gradle-and-rest-assured" title="4.1.3 Gradle and Rest Assured 2.0">Section 4.1.3, “Gradle and Rest Assured 2.0”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#gradle-snapshot-versions" title="4.1.4 Snapshot Versions for Gradle">Section 4.1.4, “Snapshot Versions for Gradle”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#gradle-add-stubs" title="4.1.5 Add stubs">Section 4.1.5, “Add stubs”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#gradle-default-setup" title="4.1.7 Default Setup">Section 4.1.7, “Default Setup”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#gradle-configure-plugin" title="4.1.8 Configure Plugin">Section 4.1.8, “Configure Plugin”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#gradle-configuration-options" title="4.1.9 Configuration Options">Section 4.1.9, “Configuration Options”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#gradle-single-base-class" title="4.1.10 Single Base Class for All Tests">Section 4.1.10, “Single Base Class for All Tests”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#gradle-different-base-classes" title="4.1.11 Different Base Classes for Contracts">Section 4.1.11, “Different Base Classes for Contracts”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#gradle-invoking-generated-tests" title="4.1.12 Invoking Generated Tests">Section 4.1.12, “Invoking Generated Tests”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#gradle-consumer" title="4.1.13 Spring Cloud Contract Verifier on the Consumer Side">Section 4.1.13, “Spring Cloud Contract Verifier on the Consumer Side”</a></li></ul></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="gradle-prerequisites" href="#gradle-prerequisites"></a>4.1.1 Prerequisites</h3></div></div></div><p>In order to use Spring Cloud Contract Verifier with WireMock, you muse use either a
|
||||
Gradle or a Maven plugin.</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>If you want to use Spock in your projects, you must add separately the
|
||||
<code class="literal">spock-core</code> and <code class="literal">spock-spring</code> modules. Check <a class="link" href="http://spockframework.github.io/" target="_top">Spock
|
||||
@@ -206,7 +206,7 @@ WireMock JSON stubs using:</p><pre class="programlisting">./gradlew generateClie
|
||||
}
|
||||
}</pre><p><code class="literal">LoanApplication</code> makes a call to <code class="literal">FraudDetection</code> service. This request is handled by a
|
||||
WireMock server configured with stubs generated by Spring Cloud Contract Verifier.</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="maven-project" href="#maven-project"></a>4.2 Maven Project</h2></div></div></div><p>To learn how to set up the Maven project for Spring Cloud Contract Verifier, read the
|
||||
following sections:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-add-plugin" title="4.2.1 Add maven plugin">Section 4.2.1, “Add maven plugin”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-rest-assured" title="4.2.2 Maven and Rest Assured 2.0">Section 4.2.2, “Maven and Rest Assured 2.0”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-snapshot-versions" title="4.2.3 Snapshot versions for Maven">Section 4.2.3, “Snapshot versions for Maven”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-add-stubs" title="4.2.4 Add stubs">Section 4.2.4, “Add stubs”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-run-plugin" title="4.2.5 Run plugin">Section 4.2.5, “Run plugin”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-configure-plugin" title="4.2.6 Configure plugin">Section 4.2.6, “Configure plugin”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-configuration-options" title="4.2.7 Configuration Options">Section 4.2.7, “Configuration Options”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-single-base" title="4.2.8 Single Base Class for All Tests">Section 4.2.8, “Single Base Class for All Tests”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-different-base" title="4.2.9 Different base classes for contracts">Section 4.2.9, “Different base classes for contracts”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-invoking-generated-tests" title="4.2.10 Invoking generated tests">Section 4.2.10, “Invoking generated tests”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-sts" title="4.2.11 Maven Plugin and STS">Section 4.2.11, “Maven Plugin and STS”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-consumer" title="4.2.12 Spring Cloud Contract Verifier on the Consumer Side">Section 4.2.12, “Spring Cloud Contract Verifier on the Consumer Side”</a></li></ul></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="maven-add-plugin" href="#maven-add-plugin"></a>4.2.1 Add maven plugin</h3></div></div></div><p>Add the Spring Cloud Contract BOM in a fashion similar to this:</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><dependencyManagement></span>
|
||||
following sections:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-add-plugin" title="4.2.1 Add maven plugin">Section 4.2.1, “Add maven plugin”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-rest-assured" title="4.2.2 Maven and Rest Assured 2.0">Section 4.2.2, “Maven and Rest Assured 2.0”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-snapshot-versions" title="4.2.3 Snapshot versions for Maven">Section 4.2.3, “Snapshot versions for Maven”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-add-stubs" title="4.2.4 Add stubs">Section 4.2.4, “Add stubs”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-run-plugin" title="4.2.5 Run plugin">Section 4.2.5, “Run plugin”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-configure-plugin" title="4.2.6 Configure plugin">Section 4.2.6, “Configure plugin”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-configuration-options" title="4.2.7 Configuration Options">Section 4.2.7, “Configuration Options”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-single-base" title="4.2.8 Single Base Class for All Tests">Section 4.2.8, “Single Base Class for All Tests”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-different-base" title="4.2.9 Different base classes for contracts">Section 4.2.9, “Different base classes for contracts”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-invoking-generated-tests" title="4.2.10 Invoking generated tests">Section 4.2.10, “Invoking generated tests”</a></li><li class="listitem"><a class="xref" href="multi__spring_cloud_contract_verifier_setup.html#maven-sts" title="4.2.11 Maven Plugin and STS">Section 4.2.11, “Maven Plugin and STS”</a></li></ul></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="maven-add-plugin" href="#maven-add-plugin"></a>4.2.1 Add maven plugin</h3></div></div></div><p>Add the Spring Cloud Contract BOM in a fashion similar to this:</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><dependencyManagement></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><dependencies></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><dependency></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>
|
||||
@@ -455,7 +455,7 @@ goal.</p><p>For Groovy Spock code, use the following:</p><pre class="programlist
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></testSources></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>To ensure that provider side is compliant with defined contracts, you need to invoke
|
||||
<code class="literal">mvn generateTest test</code>.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="maven-sts" href="#maven-sts"></a>4.2.11 Maven Plugin and STS</h3></div></div></div><p>If you see the following exception while using STS:</p><div class="informalfigure"><div class="mediaobject"><img src="https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/master/docs/src/main/asciidoc/images/sts_exception.png" alt="STS Exception"></div></div><p>When you click on the error marker you should see something like this:</p><pre class="programlisting"> plugin:<span class="hl-number">1.1</span>.<span class="hl-number">0.</span>M1:convert:default-convert:process-<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">test</span>-resources) org.apache.maven.plugin.PluginExecutionException: Execution default-convert of goal org.springframework.cloud:spring-
|
||||
<code class="literal">mvn generateTest test</code>.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="maven-sts" href="#maven-sts"></a>4.2.11 Maven Plugin and STS</h3></div></div></div><p>If you see the following exception while using STS:</p><div class="informalfigure"><div class="mediaobject"><img src="https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/1.2.x/docs/src/main/asciidoc/images/sts_exception.png" alt="STS Exception"></div></div><p>When you click on the error marker you should see something like this:</p><pre class="programlisting"> plugin:<span class="hl-number">1.1</span>.<span class="hl-number">0.</span>M1:convert:default-convert:process-<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">test</span>-resources) org.apache.maven.plugin.PluginExecutionException: Execution default-convert of goal org.springframework.cloud:spring-
|
||||
cloud-contract-maven-plugin:<span class="hl-number">1.1</span>.<span class="hl-number">0.</span>M1:convert failed. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:<span class="hl-number">145</span>) at
|
||||
org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:<span class="hl-number">331</span>) at org.eclipse.m2e.core.internal.embedder.MavenImpl$<span class="hl-number">11.</span>call(MavenImpl.java:<span class="hl-number">1362</span>) at
|
||||
...
|
||||
@@ -492,48 +492,7 @@ goal.</p><p>For Groovy Spock code, use the following:</p><pre class="programlist
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></plugin></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></plugins></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></pluginManagement></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></build></span></pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="maven-consumer" href="#maven-consumer"></a>4.2.12 Spring Cloud Contract Verifier on the Consumer Side</h3></div></div></div><p>You can also use the Spring Cloud Contract Verifier for the consumer side. To do so, use
|
||||
the plugin so that it only converts the contracts and generates the stubs. To achieve
|
||||
that, you need to configure Spring Cloud Contract Verifier plugin in exactly the same way
|
||||
as you would for a provider. You need to copy contracts stored in
|
||||
<code class="literal">src/test/resources/contracts</code> and generate WireMock JSON stubs using the
|
||||
<code class="literal">mvn generateStubs</code> command. By default, the generated WireMock mapping is stored in a
|
||||
directory named <code class="literal">target/mappings</code>. From these generated mappings, your project should
|
||||
create additional artifacts with a classifier of <code class="literal">stubs</code> for easy deployment to the maven
|
||||
repository.</p><p>Here is a sample configuration:</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>${verifier-plugin.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"><executions></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><execution></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><goals></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><goal></span>convert<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></goal></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><goal></span>generateStubs<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></goal></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></goals></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></execution></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></executions></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></plugin></span></pre><p>When present, JSON stubs can be used in consumer automated tests, as shown here:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@RunWith(SpringTestRunner.class)</span></em>
|
||||
<em><span class="hl-annotation" style="color: gray">@SpringBootTest</span></em>
|
||||
<em><span class="hl-annotation" style="color: gray">@AutoConfigureStubRunner</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">class</span> LoanApplicationServiceTests {
|
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Autowired</span></em>
|
||||
LoanApplicationService service;
|
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Test</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> shouldSuccessfullyApplyForLoan() {
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//given:</span>
|
||||
LoanApplication application =
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> LoanApplication(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Client(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"12345678901"</span>), <span class="hl-number">123.123</span>);
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//when:</span>
|
||||
LoanApplicationResult loanApplication = service.loanApplication(application);
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// then:</span>
|
||||
assertThat(loanApplication.loanApplicationStatus).isEqualTo(LoanApplicationStatus.LOAN_APPLIED);
|
||||
assertThat(loanApplication.rejectionReason).isNull();
|
||||
}
|
||||
}</pre><p><code class="literal">LoanApplication</code> makes a call to the <code class="literal">FraudDetection</code> service. This request is handled
|
||||
by a WireMock server configured with stubs generated by the Spring Cloud Contract
|
||||
Verifier.</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_stubs_and_transitive_dependencies" href="#_stubs_and_transitive_dependencies"></a>4.3 Stubs and Transitive Dependencies</h2></div></div></div><p>The Maven and Gradle plugin that add the tasks that create the stubs jar for you. One
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></build></span></pre></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_stubs_and_transitive_dependencies" href="#_stubs_and_transitive_dependencies"></a>4.3 Stubs and Transitive Dependencies</h2></div></div></div><p>The Maven and Gradle plugin that add the tasks that create the stubs jar for you. One
|
||||
problem that arises is that, when reusing the stubs, you can mistakenly import all of
|
||||
that stub’s dependencies. When building a Maven artifact, even though you have a couple
|
||||
of different jars, all of them share one pom:</p><pre class="programlisting">├── github-webhook-<span class="hl-number">0.0</span>.<span class="hl-number">1.</span>BUILD-<span class="hl-number">20160903.075506</span>-<span class="hl-number">1</span>-stubs.jar
|
||||
@@ -550,7 +509,14 @@ when you include the <code class="literal">github-webhook</code> stubs in anothe
|
||||
dependency gets downloaded by Stub Runner) then, since all of the dependencies are
|
||||
optional, they will not get downloaded.</p><p><span class="strong"><strong>Create a separate <code class="literal">artifactid</code> for the stubs</strong></span></p><p>If you create a separate <code class="literal">artifactid</code>, then you can set it up in whatever way you wish.
|
||||
For example, you might decide to have no dependencies at all.</p><p><span class="strong"><strong>Exclude dependencies on the consumer side</strong></span></p><p>As a consumer, if you add the stub dependency to your classpath, you can explicitly
|
||||
exclude the unwanted dependencies.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_scenarios" href="#_scenarios"></a>4.4 Scenarios</h2></div></div></div><p>You can handle scenarios with Spring Cloud Contract Verifier. All you need to do is to
|
||||
exclude the unwanted dependencies.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_ci_server_setup" href="#_ci_server_setup"></a>4.4 CI Server setup</h2></div></div></div><p>When fetching stubs / contracts in a CI, shared environment, what might happen is that
|
||||
both the producer and the consumer reuse the same local Maven repository. Due to this,
|
||||
the framework, responsible for downloading a stub JAR from remote location,
|
||||
can’t decide which JAR should be picked, local or remote one. That caused
|
||||
the <code class="literal">"The artifact was found in the local repository but you have explicitly
|
||||
stated that it should be downloaded from a remote one"</code> exception
|
||||
and failed the build.</p><p>For such cases we’re introducing the property mechanism:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">via <code class="literal">stubrunner.snapshot-check-skip</code> system property</li><li class="listitem">via <code class="literal">STUBRUNNER_SNAPSHOT_CHECK_SKIP</code> environment variable</li></ul></div><p>if either of these values is set to <code class="literal">true</code>, then the stub downloader will not
|
||||
verify the origin of the downloaded JAR.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_scenarios" href="#_scenarios"></a>4.5 Scenarios</h2></div></div></div><p>You can handle scenarios with Spring Cloud Contract Verifier. All you need to do is to
|
||||
stick to the proper naming convention while creating your contracts. The convention
|
||||
requires including an order number followed by an underscore. This will work regardles
|
||||
of whether you’re working with YAML or Groovy. Example:</p><pre class="screen">my_contracts_dir\
|
||||
@@ -559,10 +525,10 @@ requires including an order number followed by an underscore. This will work reg
|
||||
2_showCart.groovy
|
||||
3_logout.groovy</pre><p>Such a tree causes Spring Cloud Contract Verifier to generate WireMock’s scenario with a
|
||||
name of <code class="literal">scenario1</code> and the three following steps:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">login marked as <code class="literal">Started</code> pointing to…​</li><li class="listitem">showCart marked as <code class="literal">Step1</code> pointing to…​</li><li class="listitem">logout marked as <code class="literal">Step2</code> which will close the scenario.</li></ol></div><p>More details about WireMock scenarios can be found at
|
||||
<a class="link" href="http://wiremock.org/stateful-behaviour.html" target="_top">http://wiremock.org/stateful-behaviour.html</a></p><p>Spring Cloud Contract Verifier also generates tests with a guaranteed order of execution.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="docker-project" href="#docker-project"></a>4.5 Docker Project</h2></div></div></div><p>We’re publishing a <code class="literal">springcloud/spring-cloud-contract</code> Docker image
|
||||
<a class="link" href="http://wiremock.org/stateful-behaviour.html" target="_top">http://wiremock.org/stateful-behaviour.html</a></p><p>Spring Cloud Contract Verifier also generates tests with a guaranteed order of execution.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="docker-project" href="#docker-project"></a>4.6 Docker Project</h2></div></div></div><p>We’re publishing a <code class="literal">springcloud/spring-cloud-contract</code> Docker image
|
||||
that contains a project that will generate tests and execute them in <code class="literal">EXPLICIT</code> mode
|
||||
against a running application.</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td><th align="left">Tip</th></tr><tr><td align="left" valign="top"><p>The <code class="literal">EXPLICIT</code> mode means that the tests generated from contracts will send
|
||||
real requests and not the mocked ones.</p></td></tr></table></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_short_intro_to_maven_jars_and_binary_storage" href="#_short_intro_to_maven_jars_and_binary_storage"></a>4.5.1 Short intro to Maven, JARs and Binary storage</h3></div></div></div><p>Since the Docker image can be used by non JVM projects, it’s good to
|
||||
real requests and not the mocked ones.</p></td></tr></table></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_short_intro_to_maven_jars_and_binary_storage" href="#_short_intro_to_maven_jars_and_binary_storage"></a>4.6.1 Short intro to Maven, JARs and Binary storage</h3></div></div></div><p>Since the Docker image can be used by non JVM projects, it’s good to
|
||||
explain the basic terms behind Spring Cloud Contract packaging defaults.</p><p>Part of the following definitions were taken from the <a class="link" href="https://maven.apache.org/glossary.html" target="_top">Maven Glossary</a></p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Project</code>: Maven thinks in terms of projects. Everything that you
|
||||
will build are projects. Those projects follow a well defined
|
||||
“Project Object Model”. Projects can depend on other projects,
|
||||
@@ -589,16 +555,23 @@ like them to be available for others to download / reference or reuse. In case
|
||||
of the JVM world those artifacts would be JARs, for Ruby these are gems
|
||||
and for Docker those would be Docker images. You can store those artifacts
|
||||
in a manager. Examples of such managers can be <a class="link" href="https://jfrog.com/artifactory/" target="_top">Artifactory</a>
|
||||
or <a class="link" href="http://www.sonatype.org/nexus/" target="_top">Nexus</a>.</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_how_it_works_2" href="#_how_it_works_2"></a>4.5.2 How it works</h3></div></div></div><p>The image searches for contracts under the <code class="literal">/contracts</code> folder.
|
||||
or <a class="link" href="http://www.sonatype.org/nexus/" target="_top">Nexus</a>.</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_how_it_works_2" href="#_how_it_works_2"></a>4.6.2 How it works</h3></div></div></div><p>The image searches for contracts under the <code class="literal">/contracts</code> folder.
|
||||
The output from running the tests will be available under
|
||||
<code class="literal">/spring-cloud-contract/build</code> folder (it’s useful for debugging
|
||||
purposes).</p><p>It’s enough for you to mount your contracts, pass the environment variables
|
||||
and the image will:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">generate the contract tests</li><li class="listitem">execute the tests against the provided URL</li><li class="listitem">generate the <a class="link" href="http://wiremock.org" target="_top">WireMock</a> stubs</li><li class="listitem">(optional - turned on by default) publish the stubs to a Artifact Manager</li></ul></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_environment_variables" href="#_environment_variables"></a>Environment Variables</h4></div></div></div><p>The Docker image requires some environment variables to point to
|
||||
your running application, to the Artifact manager instance etc.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">PROJECT_GROUP</code> - your project’s group id. Defaults to <code class="literal">com.example</code>.</li><li class="listitem"><code class="literal">PROJECT_VERSION</code> - your project’s version. Defaults to <code class="literal">0.0.1-SNAPSHOT</code></li><li class="listitem"><code class="literal">PROJECT_NAME</code> - artifact id. Defaults to <code class="literal">example</code></li><li class="listitem"><code class="literal">REPO_WITH_BINARIES_URL</code> - URL of your Artifact Manager. Defaults to <code class="literal"><a class="link" href="http://localhost:8081/artifactory/libs-release-local" target="_top">http://localhost:8081/artifactory/libs-release-local</a></code>
|
||||
which is the default URL of <a class="link" href="https://jfrog.com/artifactory/" target="_top">Artifactory</a> running locally</li><li class="listitem"><code class="literal">REPO_WITH_BINARIES_USERNAME</code> - (optional) username when the Artifact Manager is secured</li><li class="listitem"><code class="literal">REPO_WITH_BINARIES_PASSWORD</code> - (optional) password when the Artifact Manager is secured</li><li class="listitem"><code class="literal">PUBLISH_ARTIFACTS</code> - if set to <code class="literal">true</code> then will publish artifact to binary storage. Defaults to <code class="literal">true</code>.</li></ul></div><p>These environment variables are used when tests are executed:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">APPLICATION_BASE_URL</code> - url against which tests should be executed.
|
||||
your running application, to the Artifact manager instance etc.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">PROJECT_GROUP</code> - your project’s group id. Defaults to <code class="literal">com.example</code></li><li class="listitem"><code class="literal">PROJECT_VERSION</code> - your project’s version. Defaults to <code class="literal">0.0.1-SNAPSHOT</code></li><li class="listitem"><code class="literal">PROJECT_NAME</code> - artifact id. Defaults to <code class="literal">example</code></li><li class="listitem"><code class="literal">REPO_WITH_BINARIES_URL</code> - URL of your Artifact Manager. Defaults to <code class="literal"><a class="link" href="http://localhost:8081/artifactory/libs-release-local" target="_top">http://localhost:8081/artifactory/libs-release-local</a></code>
|
||||
which is the default URL of <a class="link" href="https://jfrog.com/artifactory/" target="_top">Artifactory</a> running locally</li><li class="listitem"><code class="literal">REPO_WITH_BINARIES_USERNAME</code> - (optional) username when the Artifact Manager is secured</li><li class="listitem"><code class="literal">REPO_WITH_BINARIES_PASSWORD</code> - (optional) password when the Artifact Manager is secured</li><li class="listitem"><code class="literal">PUBLISH_ARTIFACTS</code> - if set to <code class="literal">true</code> then will publish artifact to binary storage. Defaults to <code class="literal">true</code>.</li></ul></div><p>These environment variables are used when contracts lay in an external repository. To enable
|
||||
this feature you must set the <code class="literal">EXTERNAL_CONTRACTS_ARTIFACT_ID</code> environment variable.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">EXTERNAL_CONTRACTS_GROUP_ID</code> - group id of the project with contracts. Defaults to <code class="literal">com.example</code></li><li class="listitem"><code class="literal">EXTERNAL_CONTRACTS_ARTIFACT_ID</code>- artifact id of the project with contracts.</li><li class="listitem"><code class="literal">EXTERNAL_CONTRACTS_CLASSIFIER</code>- classifier of the project with contracts. Empty by default</li><li class="listitem"><code class="literal">EXTERNAL_CONTRACTS_VERSION</code> - version of the project with contracts. Defaults to <code class="literal">+</code>, equivalent to picking the latest</li><li class="listitem"><code class="literal">EXTERNAL_CONTRACTS_REPO_WITH_BINARIES_URL</code> - URL of your Artifact Manager. Defaults to value of <code class="literal">REPO_WITH_BINARIES_URL</code> env var.
|
||||
If that’s not set, defaults to <code class="literal"><a class="link" href="http://localhost:8081/artifactory/libs-release-local" target="_top">http://localhost:8081/artifactory/libs-release-local</a></code>
|
||||
which is the default URL of <a class="link" href="https://jfrog.com/artifactory/" target="_top">Artifactory</a> running locally</li><li class="listitem"><code class="literal">EXTERNAL_CONTRACTS_PATH</code> - path to contracts for the given project, inside the project with contracts.
|
||||
Defaults to slash separated <code class="literal">EXTERNAL_CONTRACTS_GROUP_ID</code> concatenated with <code class="literal">/</code> and <code class="literal">EXTERNAL_CONTRACTS_ARTIFACT_ID</code>. E.g.
|
||||
for group id <code class="literal">foo.bar</code> and artifact id <code class="literal">baz</code>, would result in <code class="literal">foo/bar/baz</code> contracts path.</li><li class="listitem"><code class="literal">EXTERNAL_CONTRACTS_WORK_OFFLINE</code> - if set to <code class="literal">true</code> then will retrieve artifact with contracts
|
||||
from the container’s <code class="literal">.m2</code>. Mount your local <code class="literal">.m2</code> as a volume available at the container’s <code class="literal">/root/.m2</code> path.
|
||||
You must not set both <code class="literal">EXTERNAL_CONTRACTS_WORK_OFFLINE</code> and <code class="literal">EXTERNAL_CONTRACTS_REPO_WITH_BINARIES_URL</code>.</li></ul></div><p>These environment variables are used when tests are executed:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">APPLICATION_BASE_URL</code> - url against which tests should be executed.
|
||||
Remember that it has to be accessible from the Docker container (e.g. <code class="literal">localhost</code>
|
||||
will not work)</li><li class="listitem"><code class="literal">APPLICATION_USERNAME</code> - (optional) username for basic authentication to your application</li><li class="listitem"><code class="literal">APPLICATION_PASSWORD</code> - (optional) password for basic authentication to your application</li></ul></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_example_of_usage" href="#_example_of_usage"></a>4.5.3 Example of usage</h3></div></div></div><p>Let’s take a look at a simple MVC application</p><pre class="programlisting">$ git clone https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs
|
||||
$ <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">cd</span> bookstore</pre><p>The contracts are available under <code class="literal">/contracts</code> folder.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="docker-server-side" href="#docker-server-side"></a>4.5.4 Server side (nodejs)</h3></div></div></div><p>Since we want to run tests, we could just execute:</p><pre class="programlisting">$ npm <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">test</span></pre><p>however, for learning purposes, let’s split it into pieces:</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># Stop docker infra (nodejs, artifactory)</span>
|
||||
will not work)</li><li class="listitem"><code class="literal">APPLICATION_USERNAME</code> - (optional) username for basic authentication to your application</li><li class="listitem"><code class="literal">APPLICATION_PASSWORD</code> - (optional) password for basic authentication to your application</li></ul></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_example_of_usage" href="#_example_of_usage"></a>4.6.3 Example of usage</h3></div></div></div><p>Let’s take a look at a simple MVC application</p><pre class="programlisting">$ git clone https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs
|
||||
$ <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">cd</span> bookstore</pre><p>The contracts are available under <code class="literal">/contracts</code> folder.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="docker-server-side" href="#docker-server-side"></a>4.6.4 Server side (nodejs)</h3></div></div></div><p>Since we want to run tests, we could just execute:</p><pre class="programlisting">$ npm <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">test</span></pre><p>however, for learning purposes, let’s split it into pieces:</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># Stop docker infra (nodejs, artifactory)</span>
|
||||
$ ./stop_infra.sh
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># Start docker infra (nodejs, artifactory)</span>
|
||||
$ ./setup_infra.sh
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>11. Spring Cloud Contract WireMock</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-contract.html" title="Spring Cloud Contract"><link rel="up" href="multi_spring-cloud-contract.html" title="Spring Cloud Contract"><link rel="prev" href="multi__using_the_pluggable_architecture.html" title="10. Using the Pluggable Architecture"><link rel="next" href="multi__migrations.html" title="12. Migrations"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">11. Spring Cloud Contract WireMock</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__using_the_pluggable_architecture.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__migrations.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_spring_cloud_contract_wiremock" href="#_spring_cloud_contract_wiremock"></a>11. Spring Cloud Contract WireMock</h1></div></div></div><p>The Spring Cloud Contract WireMock modules let you use <a class="link" href="http://wiremock.org" target="_top">WireMock</a> in a
|
||||
Spring Boot application. Check out the
|
||||
<a class="link" href="https://github.com/spring-cloud/spring-cloud-contract/tree/master/samples" target="_top">samples</a>
|
||||
<a class="link" href="https://github.com/spring-cloud/spring-cloud-contract/tree/1.2.x/samples" target="_top">samples</a>
|
||||
for more details.</p><p>If you have a Spring Boot application that uses Tomcat as an embedded server (which is
|
||||
the default with <code class="literal">spring-boot-starter-web</code>), you can add
|
||||
<code class="literal">spring-cloud-contract-wiremock</code> to your classpath and add <code class="literal">@AutoConfigureWireMock</code> in
|
||||
<code class="literal">spring-cloud-starter-contract-stub-runner</code> to your classpath and add <code class="literal">@AutoConfigureWireMock</code> in
|
||||
order to be able to use Wiremock in your tests. Wiremock runs as a stub server and you
|
||||
can register stub behavior using a Java API or via static JSON declarations as part of
|
||||
your test. The following code shows an example:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@RunWith(SpringRunner.class)</span></em>
|
||||
|
||||
BIN
1.2.x/single/images/callouts/1.png
Normal file
|
After Width: | Height: | Size: 329 B |
BIN
1.2.x/single/images/callouts/2.png
Normal file
|
After Width: | Height: | Size: 353 B |
BIN
1.2.x/single/images/callouts/3.png
Normal file
|
After Width: | Height: | Size: 350 B |
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – Checkstyle Results</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -127,20 +127,6 @@ under the License.
|
||||
<td>
|
||||
0
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://github.com/spring-cloud/spring-cloud-contract/checkstyle.html#org.springframework.cloud.contract.maven.verifier.CopyContracts.java">org/springframework/cloud/contract/maven/verifier/CopyContracts.java</a>
|
||||
</td>
|
||||
<td>
|
||||
0
|
||||
</td>
|
||||
<td>
|
||||
0
|
||||
</td>
|
||||
<td>
|
||||
0
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@@ -158,7 +144,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.LocalStubRunner.java">org/springframework/cloud/contract/maven/verifier/stubrunner/LocalStubRunner.java</a>
|
||||
<a href="https://github.com/spring-cloud/spring-cloud-contract/checkstyle.html#org.springframework.cloud.contract.maven.verifier.CopyContracts.java">org/springframework/cloud/contract/maven/verifier/CopyContracts.java</a>
|
||||
</td>
|
||||
<td>
|
||||
0
|
||||
@@ -183,6 +169,20 @@ under the License.
|
||||
<td>
|
||||
0
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://github.com/spring-cloud/spring-cloud-contract/checkstyle.html#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>
|
||||
0
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – </title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – </title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – spring-cloud-contract:convert</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – spring-cloud-contract:generateStubs</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – spring-cloud-contract:generateTests</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – spring-cloud-contract:help</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – </title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – CI Management</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – Issue Management</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – </title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
@@ -329,7 +329,7 @@
|
||||
<div class="sect2">
|
||||
<h3 id="project_source_code">Project source code</h3>
|
||||
<div class="paragraph">
|
||||
<p><a href="https://github.com/spring-cloud/spring-cloud-contract/tree/master/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/spring-boot-java" class="bare">https://github.com/spring-cloud/spring-cloud-contract/tree/master/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/spring-boot-java</a></p>
|
||||
<p><a href="https://github.com/spring-cloud/spring-cloud-contract/tree/1.2.x/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/spring-boot-java" class="bare">https://github.com/spring-cloud/spring-cloud-contract/tree/1.2.x/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/spring-boot-java</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – Project Licenses</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – Plugin Documentation</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – Project Plugin Management</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – Project Plugins</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – Project Information</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – Generated Reports</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – Project Summary</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – spring-cloud-contract:run</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – Sitemap</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – Source Code Management</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – </title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
@@ -371,7 +371,7 @@
|
||||
<div class="sect2">
|
||||
<h3 id="project_source_code">Project source code</h3>
|
||||
<div class="paragraph">
|
||||
<p><a href="https://github.com/spring-cloud/spring-cloud-contract/tree/master/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/spring-boot-groovy" class="bare">https://github.com/spring-cloud/spring-cloud-contract/tree/master/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/spring-boot-groovy</a></p>
|
||||
<p><a href="https://github.com/spring-cloud/spring-cloud-contract/tree/1.2.x/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/spring-boot-groovy" class="bare">https://github.com/spring-cloud/spring-cloud-contract/tree/1.2.x/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/spring-boot-groovy</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – Project Team</title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-02-10
|
||||
| Generated by Apache Maven Doxia Site Renderer 1.6 at 2018-03-19
|
||||
| Rendered using Apache Maven Fluido Skin 1.5
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180210" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20180319" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<title>Spring Cloud Contract Maven Plugin – </title>
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
|
||||
@@ -146,7 +146,7 @@
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li id="publishDate">Last Published: 2018-02-10
|
||||
<li id="publishDate">Last Published: 2018-03-19
|
||||
<span class="divider">|</span>
|
||||
</li>
|
||||
<li id="projectVersion">Version: 1.2.4.BUILD-SNAPSHOT
|
||||
|
||||
@@ -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>2018-02-02</date>
|
||||
<date>2018-03-19</date>
|
||||
</info>
|
||||
<preface>
|
||||
<title></title>
|
||||
@@ -53,7 +53,7 @@ Spring Cloud Contract Verifier.</simpara>
|
||||
<informalfigure>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/master/docs/src/main/asciidoc/images/Deps.png"/>
|
||||
<imagedata fileref="https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/1.2.x/docs/src/main/asciidoc/images/Deps.png"/>
|
||||
</imageobject>
|
||||
<textobject><phrase>Microservices Architecture</phrase></textobject>
|
||||
</mediaobject>
|
||||
@@ -128,7 +128,7 @@ are those that your application directly uses.</simpara>
|
||||
<informalfigure>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/master/docs/src/main/asciidoc/images/Stubs2.png"/>
|
||||
<imagedata fileref="https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/1.2.x/docs/src/main/asciidoc/images/Stubs2.png"/>
|
||||
</imageobject>
|
||||
<textobject><phrase>Stubbed Services</phrase></textobject>
|
||||
</mediaobject>
|
||||
@@ -356,8 +356,8 @@ we mark the client as a fraud.</simpara>
|
||||
Issuance has an artifact-id of <literal>http-client</literal>, and both have a <literal>group-id</literal> of <literal>com.example</literal>.</simpara>
|
||||
<simpara>Social remark - both client and server development teams need to communicate directly and
|
||||
discuss changes while going through the process. CDC is all about communication.</simpara>
|
||||
<simpara>The <link xl:href="https://github.com/spring-cloud/spring-cloud-contract/tree/master/samples/standalone/dsl/http-server">server
|
||||
side code is available here</link> and <link xl:href="https://github.com/spring-cloud/spring-cloud-contract/tree/master/samples/standalone/dsl/http-client">the
|
||||
<simpara>The <link xl:href="https://github.com/spring-cloud/spring-cloud-contract/tree/1.2.x/samples/standalone/dsl/http-server">server
|
||||
side code is available here</link> and <link xl:href="https://github.com/spring-cloud/spring-cloud-contract/tree/1.2.x/samples/standalone/dsl/http-client">the
|
||||
client code here</link>.</simpara>
|
||||
<tip>
|
||||
<simpara>In this case, the producer owns the contracts. Physically, all the contract are
|
||||
@@ -1194,15 +1194,15 @@ one to one to the contents of the repo.</simpara>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>1.5.10.RELEASE</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-dependencies.version>Finchley.BUILD-SNAPSHOT</spring-cloud-dependencies.version>
|
||||
<spring-cloud-contract.version>1.2.4.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-dependencies.version>Edgware.BUILD-SNAPSHOT</spring-cloud-dependencies.version>
|
||||
<excludeBuildFolders>true</excludeBuildFolders>
|
||||
</properties>
|
||||
|
||||
@@ -1380,7 +1380,6 @@ of the JAR containing the contracts:</simpara>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<stubsMode>REMOTE</stubsMode>
|
||||
<contractsRepositoryUrl>http://link/to/your/nexus/or/artifactory/or/sth</contractsRepositoryUrl>
|
||||
<contractDependency>
|
||||
<groupId>com.example.standalone</groupId>
|
||||
@@ -1871,9 +1870,6 @@ following sections:</simpara>
|
||||
<listitem>
|
||||
<simpara><xref linkend="maven-sts"/></simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><xref linkend="maven-consumer"/></simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<section xml:id="maven-add-plugin">
|
||||
<title>Add maven plugin</title>
|
||||
@@ -2262,7 +2258,7 @@ goal.</simpara>
|
||||
<informalfigure>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/master/docs/src/main/asciidoc/images/sts_exception.png"/>
|
||||
<imagedata fileref="https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/1.2.x/docs/src/main/asciidoc/images/sts_exception.png"/>
|
||||
</imageobject>
|
||||
<textobject><phrase>STS Exception</phrase></textobject>
|
||||
</mediaobject>
|
||||
@@ -2309,56 +2305,6 @@ goal.</simpara>
|
||||
</pluginManagement>
|
||||
</build></programlisting>
|
||||
</section>
|
||||
<section xml:id="maven-consumer">
|
||||
<title>Spring Cloud Contract Verifier on the Consumer Side</title>
|
||||
<simpara>You can also use the Spring Cloud Contract Verifier for the consumer side. To do so, use
|
||||
the plugin so that it only converts the contracts and generates the stubs. To achieve
|
||||
that, you need to configure Spring Cloud Contract Verifier plugin in exactly the same way
|
||||
as you would for a provider. You need to copy contracts stored in
|
||||
<literal>src/test/resources/contracts</literal> and generate WireMock JSON stubs using the
|
||||
<literal>mvn generateStubs</literal> command. By default, the generated WireMock mapping is stored in a
|
||||
directory named <literal>target/mappings</literal>. From these generated mappings, your project should
|
||||
create additional artifacts with a classifier of <literal>stubs</literal> for easy deployment to the maven
|
||||
repository.</simpara>
|
||||
<simpara>Here is a sample configuration:</simpara>
|
||||
<programlisting language="xml" linenumbering="unnumbered"><plugin>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
|
||||
<version>${verifier-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>convert</goal>
|
||||
<goal>generateStubs</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin></programlisting>
|
||||
<simpara>When present, JSON stubs can be used in consumer automated tests, as shown here:</simpara>
|
||||
<programlisting language="groovy" linenumbering="unnumbered">@RunWith(SpringTestRunner.class)
|
||||
@SpringBootTest
|
||||
@AutoConfigureStubRunner
|
||||
public class LoanApplicationServiceTests {
|
||||
|
||||
@Autowired
|
||||
LoanApplicationService service;
|
||||
|
||||
@Test
|
||||
public void shouldSuccessfullyApplyForLoan() {
|
||||
//given:
|
||||
LoanApplication application =
|
||||
new LoanApplication(new Client("12345678901"), 123.123);
|
||||
//when:
|
||||
LoanApplicationResult loanApplication = service.loanApplication(application);
|
||||
// then:
|
||||
assertThat(loanApplication.loanApplicationStatus).isEqualTo(LoanApplicationStatus.LOAN_APPLIED);
|
||||
assertThat(loanApplication.rejectionReason).isNull();
|
||||
}
|
||||
}</programlisting>
|
||||
<simpara><literal>LoanApplication</literal> makes a call to the <literal>FraudDetection</literal> service. This request is handled
|
||||
by a WireMock server configured with stubs generated by the Spring Cloud Contract
|
||||
Verifier.</simpara>
|
||||
</section>
|
||||
</section>
|
||||
<section xml:id="_stubs_and_transitive_dependencies">
|
||||
<title>Stubs and Transitive Dependencies</title>
|
||||
@@ -2400,6 +2346,27 @@ For example, you might decide to have no dependencies at all.</simpara>
|
||||
<simpara>As a consumer, if you add the stub dependency to your classpath, you can explicitly
|
||||
exclude the unwanted dependencies.</simpara>
|
||||
</section>
|
||||
<section xml:id="_ci_server_setup">
|
||||
<title>CI Server setup</title>
|
||||
<simpara>When fetching stubs / contracts in a CI, shared environment, what might happen is that
|
||||
both the producer and the consumer reuse the same local Maven repository. Due to this,
|
||||
the framework, responsible for downloading a stub JAR from remote location,
|
||||
can’t decide which JAR should be picked, local or remote one. That caused
|
||||
the <literal>"The artifact was found in the local repository but you have explicitly
|
||||
stated that it should be downloaded from a remote one"</literal> exception
|
||||
and failed the build.</simpara>
|
||||
<simpara>For such cases we’re introducing the property mechanism:</simpara>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>via <literal>stubrunner.snapshot-check-skip</literal> system property</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>via <literal>STUBRUNNER_SNAPSHOT_CHECK_SKIP</literal> environment variable</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<simpara>if either of these values is set to <literal>true</literal>, then the stub downloader will not
|
||||
verify the origin of the downloaded JAR.</simpara>
|
||||
</section>
|
||||
<section xml:id="_scenarios">
|
||||
<title>Scenarios</title>
|
||||
<simpara>You can handle scenarios with Spring Cloud Contract Verifier. All you need to do is to
|
||||
@@ -2517,7 +2484,7 @@ purposes).</simpara>
|
||||
your running application, to the Artifact manager instance etc.</simpara>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara><literal>PROJECT_GROUP</literal> - your project’s group id. Defaults to <literal>com.example</literal>.</simpara>
|
||||
<simpara><literal>PROJECT_GROUP</literal> - your project’s group id. Defaults to <literal>com.example</literal></simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><literal>PROJECT_VERSION</literal> - your project’s version. Defaults to <literal>0.0.1-SNAPSHOT</literal></simpara>
|
||||
@@ -2539,6 +2506,37 @@ which is the default URL of <link xl:href="https://jfrog.com/artifactory/">Artif
|
||||
<simpara><literal>PUBLISH_ARTIFACTS</literal> - if set to <literal>true</literal> then will publish artifact to binary storage. Defaults to <literal>true</literal>.</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<simpara>These environment variables are used when contracts lay in an external repository. To enable
|
||||
this feature you must set the <literal>EXTERNAL_CONTRACTS_ARTIFACT_ID</literal> environment variable.</simpara>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara><literal>EXTERNAL_CONTRACTS_GROUP_ID</literal> - group id of the project with contracts. Defaults to <literal>com.example</literal></simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><literal>EXTERNAL_CONTRACTS_ARTIFACT_ID</literal>- artifact id of the project with contracts.</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><literal>EXTERNAL_CONTRACTS_CLASSIFIER</literal>- classifier of the project with contracts. Empty by default</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><literal>EXTERNAL_CONTRACTS_VERSION</literal> - version of the project with contracts. Defaults to <literal>+</literal>, equivalent to picking the latest</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><literal>EXTERNAL_CONTRACTS_REPO_WITH_BINARIES_URL</literal> - URL of your Artifact Manager. Defaults to value of <literal>REPO_WITH_BINARIES_URL</literal> env var.
|
||||
If that’s not set, defaults to <literal><link xl:href="http://localhost:8081/artifactory/libs-release-local">http://localhost:8081/artifactory/libs-release-local</link></literal>
|
||||
which is the default URL of <link xl:href="https://jfrog.com/artifactory/">Artifactory</link> running locally</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><literal>EXTERNAL_CONTRACTS_PATH</literal> - path to contracts for the given project, inside the project with contracts.
|
||||
Defaults to slash separated <literal>EXTERNAL_CONTRACTS_GROUP_ID</literal> concatenated with <literal>/</literal> and <literal>EXTERNAL_CONTRACTS_ARTIFACT_ID</literal>. E.g.
|
||||
for group id <literal>foo.bar</literal> and artifact id <literal>baz</literal>, would result in <literal>foo/bar/baz</literal> contracts path.</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><literal>EXTERNAL_CONTRACTS_WORK_OFFLINE</literal> - if set to <literal>true</literal> then will retrieve artifact with contracts
|
||||
from the container’s <literal>.m2</literal>. Mount your local <literal>.m2</literal> as a volume available at the container’s <literal>/root/.m2</literal> path.
|
||||
You must not set both <literal>EXTERNAL_CONTRACTS_WORK_OFFLINE</literal> and <literal>EXTERNAL_CONTRACTS_REPO_WITH_BINARIES_URL</literal>.</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<simpara>These environment variables are used when tests are executed:</simpara>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
@@ -3767,6 +3765,19 @@ an existing <literal>DiscoveryClient</literal> its results will be ignored. Howe
|
||||
<literal>stubrunner.cloud.delegate.enabled</literal> to <literal>true</literal> and then your existing <literal>DiscoveryClient</literal> results will be
|
||||
merged with the stubbed ones.</simpara>
|
||||
</tip>
|
||||
<simpara>The default Maven configuration used by Stub Runner can be tweaked either
|
||||
via the following system properties or environment variables</simpara>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara><literal>maven.repo.local</literal> - path to the custom maven local repository location</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><literal>org.apache.maven.user-settings</literal> - path to custom maven user settings location</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><literal>org.apache.maven.global-settings</literal> - path to maven global settings location</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</section>
|
||||
<section xml:id="_stub_runner_boot_application">
|
||||
@@ -3785,6 +3796,12 @@ project for more information.</simpara>
|
||||
<simpara>Annotate a class with <literal>@EnableStubRunnerServer</literal>, build a fat-jar and you’re ready to go!</simpara>
|
||||
<simpara>For the properties check the <emphasis role="strong">Stub Runner Spring</emphasis> section.</simpara>
|
||||
</section>
|
||||
<section xml:id="_stub_runner_server_fat_jar">
|
||||
<title>Stub Runner Server Fat Jar</title>
|
||||
<simpara>You can download a standalone JAR from Maven (for example, for version 1.2.3.RELEASE), as follows:</simpara>
|
||||
<programlisting language="bash" linenumbering="unnumbered">$ wget -O stub-runner.jar 'https://search.maven.org/remote_content?g=org.springframework.cloud&a=spring-cloud-contract-stub-runner-boot&v=1.2.3.RELEASE'
|
||||
$ java -jar stub-runner.jar --stubrunner.ids=... --stubrunner.repositoryRoot=...</programlisting>
|
||||
</section>
|
||||
<section xml:id="_spring_cloud_cli">
|
||||
<title>Spring Cloud CLI</title>
|
||||
<simpara>Starting from <literal>1.4.0.RELEASE</literal> version of the <link xl:href="http://cloud.spring.io/spring-cloud-cli">Spring Cloud CLI</link>
|
||||
@@ -8045,11 +8062,11 @@ used. If you provide more than one, then the first one on the list is used.</sim
|
||||
<title>Spring Cloud Contract WireMock</title>
|
||||
<simpara>The Spring Cloud Contract WireMock modules let you use <link xl:href="http://wiremock.org">WireMock</link> in a
|
||||
Spring Boot application. Check out the
|
||||
<link xl:href="https://github.com/spring-cloud/spring-cloud-contract/tree/master/samples">samples</link>
|
||||
<link xl:href="https://github.com/spring-cloud/spring-cloud-contract/tree/1.2.x/samples">samples</link>
|
||||
for more details.</simpara>
|
||||
<simpara>If you have a Spring Boot application that uses Tomcat as an embedded server (which is
|
||||
the default with <literal>spring-boot-starter-web</literal>), you can add
|
||||
<literal>spring-cloud-contract-wiremock</literal> to your classpath and add <literal>@AutoConfigureWireMock</literal> in
|
||||
<literal>spring-cloud-starter-contract-stub-runner</literal> to your classpath and add <literal>@AutoConfigureWireMock</literal> in
|
||||
order to be able to use Wiremock in your tests. Wiremock runs as a stub server and you
|
||||
can register stub behavior using a Java API or via static JSON declarations as part of
|
||||
your test. The following code shows an example:</simpara>
|
||||
|
||||