Sync docs from 1.2.x to gh-pages
This commit is contained in:
@@ -41,7 +41,7 @@ the <code class="literal">Contract</code> class: <code class="literal">import or
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"id"</span>:<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"01fbe706f872cb32"</span>,
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"name"</span>:<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"Washington"</span>,
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"place_type"</span>:<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"city"</span>,
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"url"</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://api.twitter.com/1/geo/id/01fbe706f872cb32.json"</span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"url"</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"https://api.twitter.com/1/geo/id/01fbe706f872cb32.json"</span>
|
||||
}
|
||||
}]
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">''</span><span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">'
|
||||
@@ -859,7 +859,7 @@ you reference a bunch of elements from the HTTP request. You can use the followi
|
||||
options:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">fromRequest().url()</code>: Returns the request URL and query parameters.</li><li class="listitem"><code class="literal">fromRequest().query(String key)</code>: Returns the first query parameter with a given name.</li><li class="listitem"><code class="literal">fromRequest().query(String key, int index)</code>: Returns the nth query parameter with a
|
||||
given name.</li><li class="listitem"><code class="literal">fromRequest().path()</code>: Returns the full path.</li><li class="listitem"><code class="literal">fromRequest().path(int index)</code>: Returns the nth path element.</li><li class="listitem"><code class="literal">fromRequest().header(String key)</code>: Returns the first header with a given name.</li><li class="listitem"><code class="literal">fromRequest().header(String key, int index)</code>: Returns the nth header with a given name.</li><li class="listitem"><code class="literal">fromRequest().body()</code>: Returns the full request body.</li><li class="listitem"><code class="literal">fromRequest().body(String jsonPath)</code>: Returns the element from the request that
|
||||
matches the JSON Path.</li></ul></div><p>If you’re using the YAML contract definition you have to use the
|
||||
<a class="link" href="http://handlebarsjs.com/" target="_top">Handlebars</a> <code class="literal">{{{ }}}</code> notation with custom, Spring Cloud Contract
|
||||
<a class="link" href="https://handlebarsjs.com/" target="_top">Handlebars</a> <code class="literal">{{{ }}}</code> notation with custom, Spring Cloud Contract
|
||||
functions to achieve this.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">{{{ request.url }}}</code>: Returns the request URL and query parameters.</li><li class="listitem"><code class="literal">{{{ request.query.key.[index] }}}</code>: Returns the nth query parameter with a given name.
|
||||
E.g. for key <code class="literal">foo</code>, first entry <code class="literal">{{{ request.query.foo.[0] }}}</code></li><li class="listitem"><code class="literal">{{{ request.path }}}</code>: Returns the full path.</li><li class="listitem"><code class="literal">{{{ request.path.[index] }}}</code>: Returns the nth path element. E.g.
|
||||
for first entry <code class="literal">`</code>{{{ request.path.[0] }}}</li><li class="listitem"><code class="literal">{{{ request.headers.key }}}</code>: Returns the first header with a given name.</li><li class="listitem"><code class="literal">{{{ request.headers.key.[index] }}}</code>: Returns the nth header with a given name.</li><li class="listitem"><code class="literal">{{{ request.body }}}</code>: Returns the full request body.</li><li class="listitem"><code class="literal">{{{ jsonpath this 'your.json.path' }}}</code>: Returns the element from the request that
|
||||
|
||||
@@ -48,7 +48,7 @@ structure presented in the previous snippet.</p><p class="primary"><b>Maven.&nbs
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><assembly</span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">xmlns</span>=<span xmlns:d="http://docbook.org/ns/docbook" class="hl-value">"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"</span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">xmlns:xsi</span>=<span xmlns:d="http://docbook.org/ns/docbook" class="hl-value">"http://www.w3.org/2001/XMLSchema-instance"</span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">xsi:schemaLocation</span>=<span xmlns:d="http://docbook.org/ns/docbook" class="hl-value">"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"</span><span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag">></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">xsi:schemaLocation</span>=<span xmlns:d="http://docbook.org/ns/docbook" class="hl-value">"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd"</span><span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag">></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><id></span>stubs<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></id></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><formats></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><format></span>jar<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></format></span>
|
||||
|
||||
@@ -275,7 +275,7 @@ Those poms are necessary for the consumer side to run <code class="literal">mvn
|
||||
is that the producer doesn’t own the contracts anymore. So the consumer and the producer have to work on
|
||||
common contracts in a common repository.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_consumer" href="#_consumer"></a>3.5.3 Consumer</h3></div></div></div><p>When the <span class="strong"><strong>consumer</strong></span> wants to work on the contracts offline, instead of cloning the producer code, the
|
||||
consumer team clones the common repository, goes to the required producer’s folder (e.g. <code class="literal">com/example/server</code>)
|
||||
and runs <code class="literal">mvn clean install -DskipTests</code> to install locally the stubs converted from the contracts.</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>You need to have <a class="link" href="http://maven.apache.org/download.cgi" target="_top">Maven installed locally</a></p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_producer" href="#_producer"></a>3.5.4 Producer</h3></div></div></div><p>As a <span class="strong"><strong>producer</strong></span> it’s enough to alter the Spring Cloud Contract Verifier to provide the URL and the dependency
|
||||
and runs <code class="literal">mvn clean install -DskipTests</code> to install locally the stubs converted from the contracts.</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>You need to have <a class="link" href="https://maven.apache.org/download.cgi" target="_top">Maven installed locally</a></p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_producer" href="#_producer"></a>3.5.4 Producer</h3></div></div></div><p>As a <span class="strong"><strong>producer</strong></span> it’s enough to alter the Spring Cloud Contract Verifier to provide the URL and the dependency
|
||||
of the JAR containing the contracts:</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>
|
||||
|
||||
@@ -158,11 +158,11 @@ publishing {
|
||||
}
|
||||
}</pre><p class="secondary">
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_stub_runner_core" href="#_stub_runner_core"></a>6.3 Stub Runner Core</h2></div></div></div><p>Runs stubs for service collaborators. Treating stubs as contracts of services allows to use stub-runner as an implementation of
|
||||
<a class="link" href="http://martinfowler.com/articles/consumerDrivenContracts.html" target="_top">Consumer Driven Contracts</a>.</p><p>Stub Runner allows you to automatically download the stubs of the provided dependencies (or pick those from the classpath), start WireMock servers for them and feed them with proper stub definitions.
|
||||
<a class="link" href="https://martinfowler.com/articles/consumerDrivenContracts.html" target="_top">Consumer Driven Contracts</a>.</p><p>Stub Runner allows you to automatically download the stubs of the provided dependencies (or pick those from the classpath), start WireMock servers for them and feed them with proper stub definitions.
|
||||
For messaging, special stub routes are defined.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_retrieving_stubs" href="#_retrieving_stubs"></a>6.3.1 Retrieving stubs</h3></div></div></div><p>You can pick the following options of acquiring stubs</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">Aether based solution that downloads JARs with stubs from Artifactory / Nexus</li><li class="listitem">Classpath scanning solution that searches classpath via pattern to retrieve stubs</li><li class="listitem">Write your own implementation of the <code class="literal">org.springframework.cloud.contract.stubrunner.StubDownloaderBuilder</code> for full customization</li></ul></div><p>The latter example is described in the <a class="link" href="">Custom Stub Runner</a> section.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_stub_downloading" href="#_stub_downloading"></a>Stub downloading</h4></div></div></div><p>If you provide the <code class="literal">stubrunner.repositoryRoot</code> or <code class="literal">stubrunner.workOffline</code> flag will be set
|
||||
to <code class="literal">true</code> then Stub Runner will connect to the given server and download the required jars.
|
||||
It will then unpack the JAR to a temporary folder and reference those files in further
|
||||
contract processing.</p><p>Example:</p><pre class="programlisting">@AutoConfigureStubRunner(repositoryRoot=<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://foo.bar"</span>, ids = <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"com.example:beer-api-producer:+:stubs:8095"</span>)</pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_classpath_scanning" href="#_classpath_scanning"></a>Classpath scanning</h4></div></div></div><p>If you <span class="strong"><strong>DON’T</strong></span> provide the <code class="literal">stubrunner.repositoryRoot</code> and <code class="literal">stubrunner.workOffline</code> flag will
|
||||
contract processing.</p><p>Example:</p><pre class="programlisting">@AutoConfigureStubRunner(repositoryRoot=<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"https://foo.bar"</span>, ids = <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"com.example:beer-api-producer:+:stubs:8095"</span>)</pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_classpath_scanning" href="#_classpath_scanning"></a>Classpath scanning</h4></div></div></div><p>If you <span class="strong"><strong>DON’T</strong></span> provide the <code class="literal">stubrunner.repositoryRoot</code> and <code class="literal">stubrunner.workOffline</code> flag will
|
||||
be set to <code class="literal">false</code> (that’s the default) then classpath will get scanned. Let’s look at the
|
||||
following example:</p><pre class="programlisting">@AutoConfigureStubRunner(ids = {
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"com.example:beer-api-producer:+:stubs:8095"</span>,
|
||||
@@ -491,7 +491,7 @@ via the following system properties or environment variables</p><div class="item
|
||||
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="_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>
|
||||
$ 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="https://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>
|
||||
@@ -608,7 +608,7 @@ the Stub Runner server. It will be available at port <code class="literal">8750<
|
||||
}</pre><p>As you can see we want to start a Stub Runner Boot server <code class="literal">@EnableStubRunnerServer</code>, enable Eureka client <code class="literal">@EnableEurekaClient</code>
|
||||
and we want to have the stub runner feature turned on <code class="literal">@AutoConfigureStubRunner</code>.</p><p>Now let’s assume that we want to start this application so that the stubs get automatically registered.
|
||||
We can do it by running the app <code class="literal">java -jar ${SYSTEM_PROPS} stub-runner-boot-eureka-example.jar</code> where
|
||||
<code class="literal">${SYSTEM_PROPS}</code> would contain the following list of properties</p><pre class="programlisting">-Dstubrunner.repositoryRoot=http://repo.spring.io/snapshots (<span class="hl-number">1</span>)
|
||||
<code class="literal">${SYSTEM_PROPS}</code> would contain the following list of properties</p><pre class="programlisting">-Dstubrunner.repositoryRoot=https://repo.spring.io/snapshots (<span class="hl-number">1</span>)
|
||||
-Dstubrunner.cloud.stubbed.discovery.enabled=false (<span class="hl-number">2</span>)
|
||||
-Dstubrunner.ids=org.springframework.cloud.contract.verifier.stubs:loanIssuance,org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer,org.springframework.cloud.contract.verifier.stubs:bootService (<span class="hl-number">3</span>)
|
||||
-Dstubrunner.idsToServiceIds.fraudDetectionServer=someNameThatShouldMapFraudDetectionServer (<span class="hl-number">4</span>)
|
||||
|
||||
@@ -552,8 +552,8 @@ side are automatically downloaded from Nexus/Artifactory. You can switch off the
|
||||
the <code class="literal">workOffline</code> parameter in your annotation. The following code shows an example of
|
||||
achieving the same thing by changing the properties.</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">stubrunner</span>:
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> ids</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">'com.example:http-server-dsl:+:stubs:8080'</span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> repositoryRoot</span>: http://repo.spring.io/libs-snapshot</pre><p>That’s it!</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_dependencies" href="#_dependencies"></a>2.5 Dependencies</h2></div></div></div><p>The best way to add dependencies is to use the proper <code class="literal">starter</code> dependency.</p><p>For <code class="literal">stub-runner</code>, use <code class="literal">spring-cloud-starter-stub-runner</code>. When you use a plugin, add
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> repositoryRoot</span>: https://repo.spring.io/libs-snapshot</pre><p>That’s it!</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_dependencies" href="#_dependencies"></a>2.5 Dependencies</h2></div></div></div><p>The best way to add dependencies is to use the proper <code class="literal">starter</code> dependency.</p><p>For <code class="literal">stub-runner</code>, use <code class="literal">spring-cloud-starter-stub-runner</code>. When you use a plugin, add
|
||||
<code class="literal">spring-cloud-starter-contract-verifier</code>.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_additional_links" href="#_additional_links"></a>2.6 Additional Links</h2></div></div></div><p>Here are some resources related to Spring Cloud Contract Verifier and Stub Runner. Note
|
||||
that some may be outdated, because the Spring Cloud Contract Verifier project is under
|
||||
constant development.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_spring_cloud_contract_video" href="#_spring_cloud_contract_video"></a>2.6.1 Spring Cloud Contract video</h3></div></div></div><p>You can check out the video from the Warsaw JUG about Spring Cloud Contract:</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_readings" href="#_readings"></a>2.6.2 Readings</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><a class="link" href="http://www.slideshare.net/MarcinGrzejszczak/stick-to-the-rules-consumer-driven-contracts-201507-confitura" target="_top">Slides from Marcin Grzejszczak’s talk about Accurest</a></li><li class="listitem"><a class="link" href="http://toomuchcoding.com/blog/categories/accurest/" target="_top">Accurest related articles from Marcin Grzejszczak’s blog</a></li><li class="listitem"><a class="link" href="http://toomuchcoding.com/blog/categories/spring-cloud-contract/" target="_top">Spring Cloud Contract related articles from Marcin Grzejszczak’s blog</a></li><li class="listitem"><a class="link" href="http://groovy-lang.org/json.html" target="_top">Groovy docs regarding JSON</a></li></ul></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_samples" href="#_samples"></a>2.7 Samples</h2></div></div></div><p>You can find some samples at
|
||||
constant development.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_spring_cloud_contract_video" href="#_spring_cloud_contract_video"></a>2.6.1 Spring Cloud Contract video</h3></div></div></div><p>You can check out the video from the Warsaw JUG about Spring Cloud Contract:</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_readings" href="#_readings"></a>2.6.2 Readings</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><a class="link" href="https://www.slideshare.net/MarcinGrzejszczak/stick-to-the-rules-consumer-driven-contracts-201507-confitura" target="_top">Slides from Marcin Grzejszczak’s talk about Accurest</a></li><li class="listitem"><a class="link" href="http://toomuchcoding.com/blog/categories/accurest/" target="_top">Accurest related articles from Marcin Grzejszczak’s blog</a></li><li class="listitem"><a class="link" href="http://toomuchcoding.com/blog/categories/spring-cloud-contract/" target="_top">Spring Cloud Contract related articles from Marcin Grzejszczak’s blog</a></li><li class="listitem"><a class="link" href="http://groovy-lang.org/json.html" target="_top">Groovy docs regarding JSON</a></li></ul></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_samples" href="#_samples"></a>2.7 Samples</h2></div></div></div><p>You can find some samples at
|
||||
<a class="link" href="https://github.com/spring-cloud-samples/spring-cloud-contract-samples" target="_top">samples</a>.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__spring_cloud_contract.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi__spring_cloud_contract_faq.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">1. Spring Cloud Contract </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-contract.html">Home</a></td><td width="40%" align="right" valign="top"> 3. Spring Cloud Contract FAQ</td></tr></table></div></body></html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<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
|
||||
<code class="literal">spock-core</code> and <code class="literal">spock-spring</code> modules. Check <a class="link" href="https://spockframework.github.io/" target="_top">Spock
|
||||
docs for more information</a></p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="gradle-add-gradle-plugin" href="#gradle-add-gradle-plugin"></a>4.1.2 Add Gradle Plugin with Dependencies</h3></div></div></div><p>To add a Gradle plugin with dependencies, use code similar to this:</p><pre class="programlisting">buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -555,7 +555,7 @@ 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.6.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="https://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
|
||||
|
||||
@@ -127,7 +127,7 @@ a Spring <code class="literal">MockRestServiceServer</code>. The following code
|
||||
<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> contextLoads() <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">throws</span> Exception {
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// will read stubs classpath</span>
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.restTemplate)
|
||||
.baseUrl(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://example.org"</span>).stubs(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"classpath:/stubs/resource.json"</span>)
|
||||
.baseUrl(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"https://example.org"</span>).stubs(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"classpath:/stubs/resource.json"</span>)
|
||||
.build();
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// We're asserting if WireMock responded properly</span>
|
||||
assertThat(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.service.go()).isEqualTo(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"Hello World"</span>);
|
||||
@@ -136,7 +136,7 @@ a Spring <code class="literal">MockRestServiceServer</code>. The following code
|
||||
}</pre><p>The <code class="literal">baseUrl</code> value is prepended to all mock calls, and the <code class="literal">stubs()</code> method takes a stub
|
||||
path resource pattern as an argument. In the preceding example, the stub defined at
|
||||
<code class="literal">/stubs/resource.json</code> is loaded into the mock server. If the <code class="literal">RestTemplate</code> is asked to
|
||||
visit <code class="literal"><a class="link" href="http://example.org/" target="_top">http://example.org/</a></code>, it gets the responses as being declared at that URL. More
|
||||
visit <code class="literal"><a class="link" href="https://example.org/" target="_top">https://example.org/</a></code>, it gets the responses as being declared at that URL. More
|
||||
than one stub pattern can be specified, and each one can be a directory (for a recursive
|
||||
list of all ".json"), a fixed filename (as in the example above), or an Ant-style
|
||||
pattern. The JSON format is the normal WireMock format, which you can read about in the
|
||||
|
||||
@@ -557,10 +557,10 @@ side are automatically downloaded from Nexus/Artifactory. You can switch off the
|
||||
the <code class="literal">workOffline</code> parameter in your annotation. The following code shows an example of
|
||||
achieving the same thing by changing the properties.</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">stubrunner</span>:
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> ids</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">'com.example:http-server-dsl:+:stubs:8080'</span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> repositoryRoot</span>: http://repo.spring.io/libs-snapshot</pre><p>That’s it!</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_dependencies" href="#_dependencies"></a>2.5 Dependencies</h2></div></div></div><p>The best way to add dependencies is to use the proper <code class="literal">starter</code> dependency.</p><p>For <code class="literal">stub-runner</code>, use <code class="literal">spring-cloud-starter-stub-runner</code>. When you use a plugin, add
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> repositoryRoot</span>: https://repo.spring.io/libs-snapshot</pre><p>That’s it!</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_dependencies" href="#_dependencies"></a>2.5 Dependencies</h2></div></div></div><p>The best way to add dependencies is to use the proper <code class="literal">starter</code> dependency.</p><p>For <code class="literal">stub-runner</code>, use <code class="literal">spring-cloud-starter-stub-runner</code>. When you use a plugin, add
|
||||
<code class="literal">spring-cloud-starter-contract-verifier</code>.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_additional_links" href="#_additional_links"></a>2.6 Additional Links</h2></div></div></div><p>Here are some resources related to Spring Cloud Contract Verifier and Stub Runner. Note
|
||||
that some may be outdated, because the Spring Cloud Contract Verifier project is under
|
||||
constant development.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_spring_cloud_contract_video" href="#_spring_cloud_contract_video"></a>2.6.1 Spring Cloud Contract video</h3></div></div></div><p>You can check out the video from the Warsaw JUG about Spring Cloud Contract:</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_readings" href="#_readings"></a>2.6.2 Readings</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><a class="link" href="http://www.slideshare.net/MarcinGrzejszczak/stick-to-the-rules-consumer-driven-contracts-201507-confitura" target="_top">Slides from Marcin Grzejszczak’s talk about Accurest</a></li><li class="listitem"><a class="link" href="http://toomuchcoding.com/blog/categories/accurest/" target="_top">Accurest related articles from Marcin Grzejszczak’s blog</a></li><li class="listitem"><a class="link" href="http://toomuchcoding.com/blog/categories/spring-cloud-contract/" target="_top">Spring Cloud Contract related articles from Marcin Grzejszczak’s blog</a></li><li class="listitem"><a class="link" href="http://groovy-lang.org/json.html" target="_top">Groovy docs regarding JSON</a></li></ul></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_samples" href="#_samples"></a>2.7 Samples</h2></div></div></div><p>You can find some samples at
|
||||
constant development.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_spring_cloud_contract_video" href="#_spring_cloud_contract_video"></a>2.6.1 Spring Cloud Contract video</h3></div></div></div><p>You can check out the video from the Warsaw JUG about Spring Cloud Contract:</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_readings" href="#_readings"></a>2.6.2 Readings</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><a class="link" href="https://www.slideshare.net/MarcinGrzejszczak/stick-to-the-rules-consumer-driven-contracts-201507-confitura" target="_top">Slides from Marcin Grzejszczak’s talk about Accurest</a></li><li class="listitem"><a class="link" href="http://toomuchcoding.com/blog/categories/accurest/" target="_top">Accurest related articles from Marcin Grzejszczak’s blog</a></li><li class="listitem"><a class="link" href="http://toomuchcoding.com/blog/categories/spring-cloud-contract/" target="_top">Spring Cloud Contract related articles from Marcin Grzejszczak’s blog</a></li><li class="listitem"><a class="link" href="http://groovy-lang.org/json.html" target="_top">Groovy docs regarding JSON</a></li></ul></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_samples" href="#_samples"></a>2.7 Samples</h2></div></div></div><p>You can find some samples at
|
||||
<a class="link" href="https://github.com/spring-cloud-samples/spring-cloud-contract-samples" target="_top">samples</a>.</p></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_spring_cloud_contract_faq" href="#_spring_cloud_contract_faq"></a>3. Spring Cloud Contract FAQ</h1></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_why_use_spring_cloud_contract_verifier_and_not_x" href="#_why_use_spring_cloud_contract_verifier_and_not_x"></a>3.1 Why use Spring Cloud Contract Verifier and not X ?</h2></div></div></div><p>For the time being Spring Cloud Contract Verifier is a JVM based tool. So it could be your first pick when you’re already creating
|
||||
software for the JVM. This project has a lot of really interesting features but especially quite a few of them definitely make
|
||||
Spring Cloud Contract Verifier stand out on the "market" of Consumer Driven Contract (CDC) tooling. Out of many the most interesting are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">Possibility to do CDC with messaging</li><li class="listitem">Clear and easy to use, statically typed DSL</li><li class="listitem">Possibility to copy paste your current JSON file to the contract and only edit its elements</li><li class="listitem">Automatic generation of tests from the defined Contract</li><li class="listitem">Stub Runner functionality - the stubs are automatically downloaded at runtime from Nexus / Artifactory</li><li class="listitem">Spring Cloud integration - no discovery service is needed for integration tests</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_i_don_t_want_to_write_a_contract_in_groovy" href="#_i_don_t_want_to_write_a_contract_in_groovy"></a>3.2 I don’t want to write a contract in Groovy!</h2></div></div></div><p>No problem. You can write a contract in YAML!</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_what_is_this_value_consumer_producer" href="#_what_is_this_value_consumer_producer"></a>3.3 What is this value(consumer(), producer()) ?</h2></div></div></div><p>One of the biggest challenges related to stubs is their reusability. Only if they can be vastly used, will they serve their purpose.
|
||||
@@ -836,7 +836,7 @@ Those poms are necessary for the consumer side to run <code class="literal">mvn
|
||||
is that the producer doesn’t own the contracts anymore. So the consumer and the producer have to work on
|
||||
common contracts in a common repository.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_consumer" href="#_consumer"></a>3.5.3 Consumer</h3></div></div></div><p>When the <span class="strong"><strong>consumer</strong></span> wants to work on the contracts offline, instead of cloning the producer code, the
|
||||
consumer team clones the common repository, goes to the required producer’s folder (e.g. <code class="literal">com/example/server</code>)
|
||||
and runs <code class="literal">mvn clean install -DskipTests</code> to install locally the stubs converted from the contracts.</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>You need to have <a class="link" href="http://maven.apache.org/download.cgi" target="_top">Maven installed locally</a></p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_producer" href="#_producer"></a>3.5.4 Producer</h3></div></div></div><p>As a <span class="strong"><strong>producer</strong></span> it’s enough to alter the Spring Cloud Contract Verifier to provide the URL and the dependency
|
||||
and runs <code class="literal">mvn clean install -DskipTests</code> to install locally the stubs converted from the contracts.</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>You need to have <a class="link" href="https://maven.apache.org/download.cgi" target="_top">Maven installed locally</a></p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_producer" href="#_producer"></a>3.5.4 Producer</h3></div></div></div><p>As a <span class="strong"><strong>producer</strong></span> it’s enough to alter the Spring Cloud Contract Verifier to provide the URL and the dependency
|
||||
of the JAR containing the contracts:</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>
|
||||
@@ -863,7 +863,7 @@ DSL and provide a path relative to where the contract lays.
|
||||
If you’re using YAML just use the <code class="literal">bodyFromFile</code> property.</p></div></div></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="#gradle-project" title="4.1 Gradle Project">As a Gradle project</a></li><li class="listitem"><a class="link" href="#maven-project" title="4.2 Maven Project">As a Maven project</a></li><li class="listitem"><a class="link" href="#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="#gradle-prerequisites" title="4.1.1 Prerequisites">Section 4.1.1, “Prerequisites”</a></li><li class="listitem"><a class="xref" href="#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="#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="#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="#gradle-add-stubs" title="4.1.5 Add stubs">Section 4.1.5, “Add stubs”</a></li><li class="listitem"><a class="xref" href="#gradle-default-setup" title="4.1.7 Default Setup">Section 4.1.7, “Default Setup”</a></li><li class="listitem"><a class="xref" href="#gradle-configure-plugin" title="4.1.8 Configure Plugin">Section 4.1.8, “Configure Plugin”</a></li><li class="listitem"><a class="xref" href="#gradle-configuration-options" title="4.1.9 Configuration Options">Section 4.1.9, “Configuration Options”</a></li><li class="listitem"><a class="xref" href="#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="#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="#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="#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
|
||||
<code class="literal">spock-core</code> and <code class="literal">spock-spring</code> modules. Check <a class="link" href="https://spockframework.github.io/" target="_top">Spock
|
||||
docs for more information</a></p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="gradle-add-gradle-plugin" href="#gradle-add-gradle-plugin"></a>4.1.2 Add Gradle Plugin with Dependencies</h3></div></div></div><p>To add a Gradle plugin with dependencies, use code similar to this:</p><pre class="programlisting">buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -1415,7 +1415,7 @@ 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.6.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="https://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
|
||||
@@ -1880,11 +1880,11 @@ publishing {
|
||||
}
|
||||
}</pre><p class="secondary">
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_stub_runner_core" href="#_stub_runner_core"></a>6.3 Stub Runner Core</h2></div></div></div><p>Runs stubs for service collaborators. Treating stubs as contracts of services allows to use stub-runner as an implementation of
|
||||
<a class="link" href="http://martinfowler.com/articles/consumerDrivenContracts.html" target="_top">Consumer Driven Contracts</a>.</p><p>Stub Runner allows you to automatically download the stubs of the provided dependencies (or pick those from the classpath), start WireMock servers for them and feed them with proper stub definitions.
|
||||
<a class="link" href="https://martinfowler.com/articles/consumerDrivenContracts.html" target="_top">Consumer Driven Contracts</a>.</p><p>Stub Runner allows you to automatically download the stubs of the provided dependencies (or pick those from the classpath), start WireMock servers for them and feed them with proper stub definitions.
|
||||
For messaging, special stub routes are defined.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_retrieving_stubs" href="#_retrieving_stubs"></a>6.3.1 Retrieving stubs</h3></div></div></div><p>You can pick the following options of acquiring stubs</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">Aether based solution that downloads JARs with stubs from Artifactory / Nexus</li><li class="listitem">Classpath scanning solution that searches classpath via pattern to retrieve stubs</li><li class="listitem">Write your own implementation of the <code class="literal">org.springframework.cloud.contract.stubrunner.StubDownloaderBuilder</code> for full customization</li></ul></div><p>The latter example is described in the <a class="link" href="#">Custom Stub Runner</a> section.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_stub_downloading" href="#_stub_downloading"></a>Stub downloading</h4></div></div></div><p>If you provide the <code class="literal">stubrunner.repositoryRoot</code> or <code class="literal">stubrunner.workOffline</code> flag will be set
|
||||
to <code class="literal">true</code> then Stub Runner will connect to the given server and download the required jars.
|
||||
It will then unpack the JAR to a temporary folder and reference those files in further
|
||||
contract processing.</p><p>Example:</p><pre class="programlisting">@AutoConfigureStubRunner(repositoryRoot=<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://foo.bar"</span>, ids = <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"com.example:beer-api-producer:+:stubs:8095"</span>)</pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_classpath_scanning" href="#_classpath_scanning"></a>Classpath scanning</h4></div></div></div><p>If you <span class="strong"><strong>DON’T</strong></span> provide the <code class="literal">stubrunner.repositoryRoot</code> and <code class="literal">stubrunner.workOffline</code> flag will
|
||||
contract processing.</p><p>Example:</p><pre class="programlisting">@AutoConfigureStubRunner(repositoryRoot=<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"https://foo.bar"</span>, ids = <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"com.example:beer-api-producer:+:stubs:8095"</span>)</pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_classpath_scanning" href="#_classpath_scanning"></a>Classpath scanning</h4></div></div></div><p>If you <span class="strong"><strong>DON’T</strong></span> provide the <code class="literal">stubrunner.repositoryRoot</code> and <code class="literal">stubrunner.workOffline</code> flag will
|
||||
be set to <code class="literal">false</code> (that’s the default) then classpath will get scanned. Let’s look at the
|
||||
following example:</p><pre class="programlisting">@AutoConfigureStubRunner(ids = {
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"com.example:beer-api-producer:+:stubs:8095"</span>,
|
||||
@@ -2213,7 +2213,7 @@ via the following system properties or environment variables</p><div class="item
|
||||
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="_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>
|
||||
$ 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="https://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>
|
||||
@@ -2330,7 +2330,7 @@ the Stub Runner server. It will be available at port <code class="literal">8750<
|
||||
}</pre><p>As you can see we want to start a Stub Runner Boot server <code class="literal">@EnableStubRunnerServer</code>, enable Eureka client <code class="literal">@EnableEurekaClient</code>
|
||||
and we want to have the stub runner feature turned on <code class="literal">@AutoConfigureStubRunner</code>.</p><p>Now let’s assume that we want to start this application so that the stubs get automatically registered.
|
||||
We can do it by running the app <code class="literal">java -jar ${SYSTEM_PROPS} stub-runner-boot-eureka-example.jar</code> where
|
||||
<code class="literal">${SYSTEM_PROPS}</code> would contain the following list of properties</p><pre class="programlisting">-Dstubrunner.repositoryRoot=http://repo.spring.io/snapshots (<span class="hl-number">1</span>)
|
||||
<code class="literal">${SYSTEM_PROPS}</code> would contain the following list of properties</p><pre class="programlisting">-Dstubrunner.repositoryRoot=https://repo.spring.io/snapshots (<span class="hl-number">1</span>)
|
||||
-Dstubrunner.cloud.stubbed.discovery.enabled=false (<span class="hl-number">2</span>)
|
||||
-Dstubrunner.ids=org.springframework.cloud.contract.verifier.stubs:loanIssuance,org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer,org.springframework.cloud.contract.verifier.stubs:bootService (<span class="hl-number">3</span>)
|
||||
-Dstubrunner.idsToServiceIds.fraudDetectionServer=someNameThatShouldMapFraudDetectionServer (<span class="hl-number">4</span>)
|
||||
@@ -2821,7 +2821,7 @@ the <code class="literal">Contract</code> class: <code class="literal">import or
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"id"</span>:<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"01fbe706f872cb32"</span>,
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"name"</span>:<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"Washington"</span>,
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"place_type"</span>:<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"city"</span>,
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"url"</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://api.twitter.com/1/geo/id/01fbe706f872cb32.json"</span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"url"</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"https://api.twitter.com/1/geo/id/01fbe706f872cb32.json"</span>
|
||||
}
|
||||
}]
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">''</span><span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">'
|
||||
@@ -3639,7 +3639,7 @@ you reference a bunch of elements from the HTTP request. You can use the followi
|
||||
options:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">fromRequest().url()</code>: Returns the request URL and query parameters.</li><li class="listitem"><code class="literal">fromRequest().query(String key)</code>: Returns the first query parameter with a given name.</li><li class="listitem"><code class="literal">fromRequest().query(String key, int index)</code>: Returns the nth query parameter with a
|
||||
given name.</li><li class="listitem"><code class="literal">fromRequest().path()</code>: Returns the full path.</li><li class="listitem"><code class="literal">fromRequest().path(int index)</code>: Returns the nth path element.</li><li class="listitem"><code class="literal">fromRequest().header(String key)</code>: Returns the first header with a given name.</li><li class="listitem"><code class="literal">fromRequest().header(String key, int index)</code>: Returns the nth header with a given name.</li><li class="listitem"><code class="literal">fromRequest().body()</code>: Returns the full request body.</li><li class="listitem"><code class="literal">fromRequest().body(String jsonPath)</code>: Returns the element from the request that
|
||||
matches the JSON Path.</li></ul></div><p>If you’re using the YAML contract definition you have to use the
|
||||
<a class="link" href="http://handlebarsjs.com/" target="_top">Handlebars</a> <code class="literal">{{{ }}}</code> notation with custom, Spring Cloud Contract
|
||||
<a class="link" href="https://handlebarsjs.com/" target="_top">Handlebars</a> <code class="literal">{{{ }}}</code> notation with custom, Spring Cloud Contract
|
||||
functions to achieve this.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">{{{ request.url }}}</code>: Returns the request URL and query parameters.</li><li class="listitem"><code class="literal">{{{ request.query.key.[index] }}}</code>: Returns the nth query parameter with a given name.
|
||||
E.g. for key <code class="literal">foo</code>, first entry <code class="literal">{{{ request.query.foo.[0] }}}</code></li><li class="listitem"><code class="literal">{{{ request.path }}}</code>: Returns the full path.</li><li class="listitem"><code class="literal">{{{ request.path.[index] }}}</code>: Returns the nth path element. E.g.
|
||||
for first entry <code class="literal">`</code>{{{ request.path.[0] }}}</li><li class="listitem"><code class="literal">{{{ request.headers.key }}}</code>: Returns the first header with a given name.</li><li class="listitem"><code class="literal">{{{ request.headers.key.[index] }}}</code>: Returns the nth header with a given name.</li><li class="listitem"><code class="literal">{{{ request.body }}}</code>: Returns the full request body.</li><li class="listitem"><code class="literal">{{{ jsonpath this 'your.json.path' }}}</code>: Returns the element from the request that
|
||||
@@ -5252,7 +5252,7 @@ a Spring <code class="literal">MockRestServiceServer</code>. The following code
|
||||
<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> contextLoads() <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">throws</span> Exception {
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// will read stubs classpath</span>
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.restTemplate)
|
||||
.baseUrl(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://example.org"</span>).stubs(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"classpath:/stubs/resource.json"</span>)
|
||||
.baseUrl(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"https://example.org"</span>).stubs(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"classpath:/stubs/resource.json"</span>)
|
||||
.build();
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// We're asserting if WireMock responded properly</span>
|
||||
assertThat(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.service.go()).isEqualTo(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"Hello World"</span>);
|
||||
@@ -5261,7 +5261,7 @@ a Spring <code class="literal">MockRestServiceServer</code>. The following code
|
||||
}</pre><p>The <code class="literal">baseUrl</code> value is prepended to all mock calls, and the <code class="literal">stubs()</code> method takes a stub
|
||||
path resource pattern as an argument. In the preceding example, the stub defined at
|
||||
<code class="literal">/stubs/resource.json</code> is loaded into the mock server. If the <code class="literal">RestTemplate</code> is asked to
|
||||
visit <code class="literal"><a class="link" href="http://example.org/" target="_top">http://example.org/</a></code>, it gets the responses as being declared at that URL. More
|
||||
visit <code class="literal"><a class="link" href="https://example.org/" target="_top">https://example.org/</a></code>, it gets the responses as being declared at that URL. More
|
||||
than one stub pattern can be specified, and each one can be a directory (for a recursive
|
||||
list of all ".json"), a fixed filename (as in the example above), or an Ant-style
|
||||
pattern. The JSON format is the normal WireMock format, which you can read about in the
|
||||
@@ -5460,7 +5460,7 @@ structure presented in the previous snippet.</p><p class="primary"><b>Maven.&nbs
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><assembly</span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">xmlns</span>=<span xmlns:d="http://docbook.org/ns/docbook" class="hl-value">"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"</span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">xmlns:xsi</span>=<span xmlns:d="http://docbook.org/ns/docbook" class="hl-value">"http://www.w3.org/2001/XMLSchema-instance"</span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">xsi:schemaLocation</span>=<span xmlns:d="http://docbook.org/ns/docbook" class="hl-value">"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"</span><span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag">></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">xsi:schemaLocation</span>=<span xmlns:d="http://docbook.org/ns/docbook" class="hl-value">"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd"</span><span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag">></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><id></span>stubs<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></id></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><formats></span>
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"><format></span>jar<span xmlns:d="http://docbook.org/ns/docbook" class="hl-tag"></format></span>
|
||||
|
||||
@@ -344,103 +344,268 @@ limitations under the License.</p><a class="externalLink" href="https://www.apac
|
||||
<p>Copy of the license follows:</p>
|
||||
<!-- Navigation -->
|
||||
<header>
|
||||
<nav class="navbar navbar-default navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#mainnav-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a href="https://www.apache.org/licenses/#" class="navbar-brand"><span class="glyphicon glyphicon-home"></span></a>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="mainnav-collapse">
|
||||
<div style="line-height:20px; padding-top:5px; float:left"><a href="https://www.apache.org/">Home</a> » <a href="https://www.apache.org/licenses/">Licenses</a></div>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="dropdown">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">About <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://www.apache.org/foundation">Overview</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/members.html">Members</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/how-it-works.html">Process</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/glossary.html">Glossary</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/preFAQ.html">FAQ</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/policies/conduct.html">Code of Conduct</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/contact.html ">Contact</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="https://www.apache.org/index.html#projects-list">Projects</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">People <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="http://people.apache.org/">Overview</a></li>
|
||||
<li><a href="http://people.apache.org/committer-index.html">Committers</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/how-it-works.html#meritocracy">Meritocracy</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/how-it-works.html#roles">Roles</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/policies/conduct.html">Code of Conduct</a></li>
|
||||
<li><a href="http://planet.apache.org/">Planet Apache</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">Get Involved <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://www.apache.org/foundation/getinvolved.html">Overview</a></li>
|
||||
<li><a href="http://community.apache.org/">Community Development</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/policies/conduct.html">Code of Conduct</a></li>
|
||||
<li><a href="http://helpwanted.apache.org/">Help Wanted</a></li>
|
||||
<li><a href="http://www.apachecon.com/">ApacheCon</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="https://www.apache.org/dyn/closer.cgi">Download</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">Support Apache <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/contributing.html">Donations</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/thanks.html">Thanks</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<!-- / Navigation -->
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-5 col-xs-12">
|
||||
<img src="https://www.apache.org/img/asf_logo.png" alt="Apache Logo" style="max-width: 100%;">
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-3 col-xs-6">
|
||||
<a href="http://apache.org/foundation/contributing.html" title="Support Apache">
|
||||
<img src="https://www.apache.org/images/SupportApache-small.png" style="height: 150px; width: 150px; margin-top: 5px; margin-bottom: 5px;">
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-4 col-xs-6">
|
||||
<div class="input-group" style="margin-bottom: 5px;">
|
||||
<script>
|
||||
(function() {
|
||||
var cx = '005703438322411770421:5mgshgrgx2u';
|
||||
var gcse = document.createElement('script');
|
||||
gcse.type = 'text/javascript';
|
||||
gcse.async = true;
|
||||
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
|
||||
'//cse.google.com/cse.js?cx=' + cx;
|
||||
var s = document.getElementsByTagName('script')[0];
|
||||
s.parentNode.insertBefore(gcse, s);
|
||||
})();
|
||||
</script>
|
||||
<gcse:searchbox-only></gcse:searchbox-only>
|
||||
<nav class="navbar navbar-inverse navbar-fixed-top mainmenu">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#mainnav-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="mainnav-collapse">
|
||||
<ul class="nav navbar-nav navbar-justified">
|
||||
<form class="visible-xs">
|
||||
<div class="input-group" style="width: 100%;">
|
||||
<script>
|
||||
(function() {
|
||||
var cx = '005703438322411770421:5mgshgrgx2u';
|
||||
var gcse = document.createElement('script');
|
||||
gcse.type = 'text/javascript';
|
||||
gcse.async = true;
|
||||
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
|
||||
'//cse.google.com/cse.js?cx=' + cx;
|
||||
var s = document.getElementsByTagName('script')[0];
|
||||
s.parentNode.insertBefore(gcse, s);
|
||||
})();
|
||||
</script>
|
||||
<gcse:searchbox-only></gcse:searchbox-only>
|
||||
</div>
|
||||
</form>
|
||||
<li><a href="https://apache.org/index.html#news">News</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">About <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://apache.org/foundation">Overview</a></li>
|
||||
<li><a href="https://apache.org/foundation/how-it-works.html">Process</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/governance/">Governance</a></li>
|
||||
<li><a href="https://www.apache.org/theapacheway/index.html">The Apache Way</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/governance/members.html">Membership</a></li>
|
||||
<li><a href="https://community.apache.org/">Community</a></li>
|
||||
<li><a href="https://apache.org/foundation/glossary.html">Glossary</a></li>
|
||||
<li><a href="https://apache.org/foundation/preFAQ.html">FAQ</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/policies/conduct">Code of Conduct</a></li>
|
||||
<li><a href="https://apache.org/foundation/contributing.html">Support Apache</a></li>
|
||||
<li><a href="https://apache.org/press/">Media/Analysts</a></li>
|
||||
<li><a href="https://apache.org/foundation/contact.html">Contact</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">Make a Donation <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://apache.org/foundation/contributing.html">Donate Now</a></li>
|
||||
<li><a href="https://donate.apache.org/"> Via Credit Card</a></li>
|
||||
<li><a href="https://donate.apache.org/"> Via ACH</a></li>
|
||||
<li><a href="https://donate.apache.org/"> Via PayPal</a></li>
|
||||
<li><a href="https://apache.org/foundation/contributing.html#Bitcoin"> Using Bigcoin</a></li>
|
||||
<li><a href="https://www.redbubble.com/people/comdev">Buy Swag</a></li>
|
||||
<li><a href="https://smile.amazon.com/gp/chpf/homepage/ref=smi_se_scyc_srch_stsr?q=apache+software+foundation&orig=%2F">Shop smile.amazon.com</a></li>
|
||||
<li><a href="https://apache.org/foundation/sponsorship.html">ASF Sponsorship</a></li>
|
||||
<li><a href="https://apache.org/foundation/thanks#targeted-sponsors">Targeted Sponsorship</a></li>
|
||||
<li><a href="https://apache.org/foundation/contributing.html#CorporateGiving">Corporate Giving</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdopwn-toggle" data-toggle="dropdown">The Apache Way <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="http://www.apache.org/theapacheway/index.html">The Apache Way</a></li>
|
||||
<li><a href="https://s.apache.org/GhnI">Sustainable Open Source</a></li>
|
||||
<li><a href="https://apache.org/foundation/how-it-works.html">How it Works</a></li>
|
||||
<li><a href="https://apache.org/foundation/how-it-works.html#meritocracy">Merit</a></li>
|
||||
<li><a href="https://blogs.apache.org/foundation/category/SuccessAtApache">Success at Apache</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdopwn-toggle" data-toggle="dropdown">Join Us <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://community.apache.org/gettingStarted/101.html">Getting Started</a></li>
|
||||
<li><a href="https://helpwanted.apache.org/">Help Wanted</a></li>
|
||||
<li><a href="https://www.apachecon.com/">ApacheCon</a></li>
|
||||
<li><a href="http://community.apache.org/calendars/">Community Events</a></li>
|
||||
<li><a href="https://apache.org/travel/">Travel Assistance</a></li>
|
||||
<li><a href="https://community.apache.org/gsoc.html">Summer of Code</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/policies/conduct">Code of Conduct</a></li>
|
||||
<li><a href="https://community.apache.org/contributors/etiquette">Etiquette</a></li>
|
||||
<li class="dropdown dropdown-submenu visible-xs">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">Projects <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://apache.org/index.html#projects-list">Project List</a></li>
|
||||
<li><a href="https://www.apache.org/licenses/#">How they work</a></li>
|
||||
<li><a href="https://community.apache.org/projectIndependence.html">Independence</a></li>
|
||||
<li><a href="https://projects.apache.org/committees.html?date">Date Founded</a></li>
|
||||
<li><a href="https://projects.apache.org/projects.html?name">Names</a></li>
|
||||
<li><a href="https://projects.apache.org/projects.html?category">Categories</a></li>
|
||||
<li><a href="https://projects.apache.org/projects.html?language">Languages</a></li>
|
||||
<li><a href="https://projects.apache.org/statistics.html">Statistics</a></li>
|
||||
<li><a href="https://incubator.apache.org/">Apache Incubator</a></li>
|
||||
<li><a href="https://helpwanted.apache.org/">Help Wanted</a></li>
|
||||
<li><a href="https://apache.org/foundation/marks/">Brand Management</a></li>
|
||||
<li><a href="https://apache.org/foundation/glossary.html">Glossary of Terms</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="drowpdown dropdown-submenu visible-xs">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">People <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://www.apache.org/foundation/how-it-works.html#roles">Roles</a></li>
|
||||
<li><a href="https://apache.org/foundation/members.html">Members</a></li>
|
||||
<li><a href="https://community.apache.org/contributors/">Committers</a></li>
|
||||
<li><a href="https://apache.org/foundation/#who-runs-the-asf">Board of Directors</a></li>
|
||||
<li><a href="https://apache.org/foundation/#who-runs-the-asf">Officers & Product VPs</a></li>
|
||||
<li><a href="https://community.zones.apache.org/map.html">Heat Map</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/policies/conduct">Code of Conduct</a></li>
|
||||
<li><a href="https://people.apache.org/">Committer Directory</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="drowpdown dropdown-submenu visible-xs">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">Community <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://community.apache.org/about/">Community Development</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/policies/conduct">Code of Conduct</a></li>
|
||||
<li><a href="https://community.apache.org/">Get Involved</a></li>
|
||||
<li><a href="https://community.apache.org/mentoringprogramme.html">Mentoring</a></li>
|
||||
<li><a href="https://helpwanted.apache.org/">Help Wanted</a></li>
|
||||
<li><a href="https://community.apache.org/calendars/">Community Events</a></li>
|
||||
<li><a href="https://community.apache.org/newbiefaq.html">FAQ</a></li>
|
||||
<li><a href="https://community.apache.org/lists.html">Mailing Lists</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="drowpdown dropdown-submenu visible-xs">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">License <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://apache.org/licenses/">Apache License</a></li>
|
||||
<li><a href="https://apache.org/foundation/license-faq.html">Licensing FAQ</a></li>
|
||||
<li><a href="https://www.apache.org/licenses/#clas">Contributor License Agreements</a></li>
|
||||
<li><a href="https://www.apache.org/licenses/#grants">Software Grants</a></li>
|
||||
<li><a href="https://apache.org/foundation/marks/list/">Trademarks</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="drowpdown dropdown-submenu visible-xs">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">Sponsors <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://apache.org/foundation/sponsorship.html">Sponsor the ASF</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/thanks">Sponsor Thanks</a></li>
|
||||
<li><a href="https://apache.org/foundation/contributing.html#CorporateGiving">Corporate Giving</a></li>
|
||||
<li><a href="https://apache.org/foundation/contributing.html">Individual Donations</a></li>
|
||||
<li><a href="https://www.redbubble.com/people/comdev/">Buy Stuff</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">Downloads <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://www.apache.org/dist/">Distribution</a></li>
|
||||
<li><a href="https://projects.apache.org/releases.html">Releases</a></li>
|
||||
<li><a href="https://apache.org/dyn/closer.cgi">Mirrors</a></li>
|
||||
<li><a href="https://status.apache.org/">Infrastructure Status</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown hidden-xs">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-search"
|
||||
aria-hidden="true"></span><span class="sr-only">Search</span></a>
|
||||
<ul class="dropdown-menu search-form" role="search">
|
||||
<div class="input-group" style="width: 100%; padding: 0 5px;">
|
||||
<script>
|
||||
(function() {
|
||||
var cx = '005703438322411770421:5mgshgrgx2u';
|
||||
var gcse = document.createElement('script');
|
||||
gcse.type = 'text/javascript';
|
||||
gcse.async = true;
|
||||
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
|
||||
'//cse.google.com/cse.js?cx=' + cx;
|
||||
var s = document.getElementsByTagName('script')[0];
|
||||
s.parentNode.insertBefore(gcse, s);
|
||||
})();
|
||||
</script>
|
||||
<gcse:searchbox-only></gcse:searchbox-only>
|
||||
</div>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<a role="button" class="btn btn-block btn-default btn-xs" href="https://www.apache.org/foundation/how-it-works.html">The Apache Way</a>
|
||||
<a role="button" class="btn btn-block btn-default btn-xs" href="https://community.apache.org/contributors/">Contribute</a>
|
||||
<a role="button" class="btn btn-block btn-default btn-xs" href="https://www.apache.org/foundation/thanks.html">ASF Sponsors</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<!-- / Navigation -->
|
||||
<header id="main-header" class="container">
|
||||
<div class="sideImg">
|
||||
<a class="visible-home" href="http://apachecon.com/"><img class="img-responsive" src="https://www.apache.org/img/ApacheCon-PROMO-2019.gif" alt="ApacheCon is Coming 9-12 Sept. 2019 - Las Vegas" /></a>
|
||||
<a class="hidden-home" href="http://apache.org/"><img class="img-responsive" src="https://www.apache.org/img/ASF20thAnniversary.jpg" alt="The Apache Software Foundation" /></a>
|
||||
</div>
|
||||
<div class="main">
|
||||
<img class="img-responsive center-block visible-home" src="https://www.apache.org/img/ASF20thAnniversary.jpg" alt="Apache 20th Anniversary Logo" />
|
||||
<h2 class="text-center">Celebrating 20 years of community-led development "The Apache Way"</h2>
|
||||
<ul class="nav navbar-nav navbar-justified">
|
||||
<li class="drowpdown">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">Projects <span class="caret hidden-sm"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://apache.org/index.html#projects-list">Project List</a></li>
|
||||
<li><a href="https://www.apache.org/licenses/#">How they work</a></li>
|
||||
<li><a href="https://community.apache.org/projectIndependence.html">Independence</a></li>
|
||||
<li><a href="https://projects.apache.org/committees.html?date">Date Founded</a></li>
|
||||
<li><a href="https://projects.apache.org/projects.html?name">Names</a></li>
|
||||
<li><a href="https://projects.apache.org/projects.html?category">Categories</a></li>
|
||||
<li><a href="https://projects.apache.org/projects.html?language">Languages</a></li>
|
||||
<li><a href="https://projects.apache.org/statistics.html">Statistics</a></li>
|
||||
<li><a href="https://incubator.apache.org/">Apache Incubator</a></li>
|
||||
<li><a href="https://helpwanted.apache.org/">Help Wanted</a></li>
|
||||
<li><a href="https://apache.org/foundation/marks/">Brand Management</a></li>
|
||||
<li><a href="https://apache.org/foundation/glossary.html">Glossary of Terms</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">People <span class="caret hidden-sm"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://www.apache.org/foundation/how-it-works.html#roles">Roles</a></li>
|
||||
<li><a href="https://apache.org/foundation/members.html">Members</a></li>
|
||||
<li><a href="https://community.apache.org/contributors/">Committers</a></li>
|
||||
<li><a href="https://apache.org/foundation/#who-runs-the-asf">Board of Directors</a></li>
|
||||
<li><a href="https://apache.org/foundation/#who-runs-the-asf">Officers & Product VPs</a></li>
|
||||
<li><a href="https://community.zones.apache.org/map.html">Heat Map</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/policies/conduct">Code of Conduct</a></li>
|
||||
<li><a href="https://people.apache.org/">Committer Directory</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">Community <span class="caret hidden-sm"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://community.apache.org/about/">Community Development</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/policies/conduct">Code of Conduct</a></li>
|
||||
<li><a href="https://community.apache.org/">Get Involved</a></li>
|
||||
<li><a href="https://community.apache.org/mentoringprogramme.html">Mentoring</a></li>
|
||||
<li><a href="https://helpwanted.apache.org/">Help Wanted</a></li>
|
||||
<li><a href="https://community.apache.org/calendars/">Community Events</a></li>
|
||||
<li><a href="https://community.apache.org/newbiefaq.html">FAQ</a></li>
|
||||
<li><a href="https://community.apache.org/lists.html">Mailing Lists</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">License <span class="caret hidden-sm"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://apache.org/licenses/">Apache License</a></li>
|
||||
<li><a href="https://apache.org/foundation/license-faq.html">Licensing FAQ</a></li>
|
||||
<li><a href="https://www.apache.org/licenses/#clas">Contributor License Agreements</a></li>
|
||||
<li><a href="https://www.apache.org/licenses/#grants">Software Grants</a></li>
|
||||
<li><a href="https://apache.org/foundation/marks/list/">Trademarks</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="https://www.apache.org/licenses/#" class="dropdown-toggle" data-toggle="dropdown">Sponsors <span class="caret hidden-sm"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://apache.org/foundation/sponsorship.html">Sponsor the ASF</a></li>
|
||||
<li><a href="https://www.apache.org/foundation/thanks">Sponsor Thanks</a></li>
|
||||
<li><a href="https://apache.org/foundation/contributing.html#CorporateGiving">Corporate Giving</a></li>
|
||||
<li><a href="https://apache.org/foundation/contributing.html">Individual Donations</a></li>
|
||||
<li><a href="https://www.redbubble.com/people/comdev/">Buy Stuff</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="sideImg">
|
||||
<a href="http://apache.org/foundation/contributing.html"><img class="img-responsive" src="https://www.apache.org/img/support-apache.jpg" alt="Apache Support Logo" /></a>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container"><style type="text/css">
|
||||
/* The following code is added by mdx_elementid.py
|
||||
It was originally lifted from http://subversion.apache.org/style/site.css */
|
||||
@@ -452,6 +617,17 @@ limitations under the License.</p><a class="externalLink" href="https://www.apac
|
||||
visibility: hidden;
|
||||
}
|
||||
h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
|
||||
<style type="text/css">
|
||||
/* The following code is added by mdx_elementid.py
|
||||
It was originally lifted from http://subversion.apache.org/style/site.css */
|
||||
/*
|
||||
* Hide class="elementid-permalink", except when an enclosing heading
|
||||
* has the :hover property.
|
||||
*/
|
||||
.headerlink, .elementid-permalink {
|
||||
visibility: hidden;
|
||||
}
|
||||
h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
|
||||
<p>Apache License<br></br>Version 2.0, January 2004<br></br>
|
||||
<a href="http://www.apache.org/licenses/">http://www.apache.org/licenses/</a> </p>
|
||||
<p>TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION</p>
|
||||
@@ -710,8 +886,8 @@ limitations under the License.
|
||||
<hr class="col-lg-12 hr-white" />
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<p class="text-center">Copyright © 2018 The Apache Software Foundation, Licensed under the <a class="white" href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
|
||||
<p class="text-center">Apache and the Apache feather logo are trademarks of The Apache Software Foundation.</p>
|
||||
<p class="text-center">Copyright © 2019 The Apache Software Foundation, Licensed under the <a class="white" href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
|
||||
<p class="text-center">Apache and the Apache feather logo are trademarks of The Apache Software Foundation. </p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -720,8 +896,21 @@ limitations under the License.
|
||||
|
||||
<!-- / Footer -->
|
||||
|
||||
<script src="/js/jquery-2.1.1.min.js"></script>
|
||||
<script src="/js/bootstrap.js"></script>
|
||||
<script src="/js/jquery-2.1.1.min.js"></script>
|
||||
<script src="/js/bootstrap.js"></script>
|
||||
<script>
|
||||
(function($){
|
||||
$(document).ready(function(){
|
||||
$('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
$(this).parent().siblings().removeClass('open');
|
||||
$(this).parent().toggleClass('open');
|
||||
console.log('WOrked');
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -924,7 +924,7 @@ the <literal>workOffline</literal> parameter in your annotation. The following c
|
||||
achieving the same thing by changing the properties.</simpara>
|
||||
<programlisting language="yaml" linenumbering="unnumbered">stubrunner:
|
||||
ids: 'com.example:http-server-dsl:+:stubs:8080'
|
||||
repositoryRoot: http://repo.spring.io/libs-snapshot</programlisting>
|
||||
repositoryRoot: https://repo.spring.io/libs-snapshot</programlisting>
|
||||
<simpara>That’s it!</simpara>
|
||||
</section>
|
||||
</section>
|
||||
@@ -948,7 +948,7 @@ constant development.</simpara>
|
||||
<title>Readings</title>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara><link xl:href="http://www.slideshare.net/MarcinGrzejszczak/stick-to-the-rules-consumer-driven-contracts-201507-confitura">Slides from Marcin Grzejszczak’s talk about Accurest</link></simpara>
|
||||
<simpara><link xl:href="https://www.slideshare.net/MarcinGrzejszczak/stick-to-the-rules-consumer-driven-contracts-201507-confitura">Slides from Marcin Grzejszczak’s talk about Accurest</link></simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><link xl:href="http://toomuchcoding.com/blog/categories/accurest/">Accurest related articles from Marcin Grzejszczak’s blog</link></simpara>
|
||||
@@ -1367,7 +1367,7 @@ Those poms are necessary for the consumer side to run <literal>mvn clean install
|
||||
consumer team clones the common repository, goes to the required producer’s folder (e.g. <literal>com/example/server</literal>)
|
||||
and runs <literal>mvn clean install -DskipTests</literal> to install locally the stubs converted from the contracts.</simpara>
|
||||
<tip>
|
||||
<simpara>You need to have <link xl:href="http://maven.apache.org/download.cgi">Maven installed locally</link></simpara>
|
||||
<simpara>You need to have <link xl:href="https://maven.apache.org/download.cgi">Maven installed locally</link></simpara>
|
||||
</tip>
|
||||
</section>
|
||||
<section xml:id="_producer">
|
||||
@@ -1492,7 +1492,7 @@ following sections:</simpara>
|
||||
Gradle or a Maven plugin.</simpara>
|
||||
<warning>
|
||||
<simpara>If you want to use Spock in your projects, you must add separately the
|
||||
<literal>spock-core</literal> and <literal>spock-spring</literal> modules. Check <link xl:href="http://spockframework.github.io/">Spock
|
||||
<literal>spock-core</literal> and <literal>spock-spring</literal> modules. Check <link xl:href="https://spockframework.github.io/">Spock
|
||||
docs for more information</link></simpara>
|
||||
</warning>
|
||||
</section>
|
||||
@@ -2450,7 +2450,7 @@ 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 <link xl:href="https://jfrog.com/artifactory/">Artifactory</link>
|
||||
or <link xl:href="http://www.sonatype.org/nexus/">Nexus</link>.</simpara>
|
||||
or <link xl:href="https://www.sonatype.org/nexus/">Nexus</link>.</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
@@ -3210,7 +3210,7 @@ publishing {
|
||||
<section xml:id="_stub_runner_core">
|
||||
<title>Stub Runner Core</title>
|
||||
<simpara>Runs stubs for service collaborators. Treating stubs as contracts of services allows to use stub-runner as an implementation of
|
||||
<link xl:href="http://martinfowler.com/articles/consumerDrivenContracts.html">Consumer Driven Contracts</link>.</simpara>
|
||||
<link xl:href="https://martinfowler.com/articles/consumerDrivenContracts.html">Consumer Driven Contracts</link>.</simpara>
|
||||
<simpara>Stub Runner allows you to automatically download the stubs of the provided dependencies (or pick those from the classpath), start WireMock servers for them and feed them with proper stub definitions.
|
||||
For messaging, special stub routes are defined.</simpara>
|
||||
<section xml:id="_retrieving_stubs">
|
||||
@@ -3235,7 +3235,7 @@ to <literal>true</literal> then Stub Runner will connect to the given server and
|
||||
It will then unpack the JAR to a temporary folder and reference those files in further
|
||||
contract processing.</simpara>
|
||||
<simpara>Example:</simpara>
|
||||
<programlisting language="java" linenumbering="unnumbered">@AutoConfigureStubRunner(repositoryRoot="http://foo.bar", ids = "com.example:beer-api-producer:+:stubs:8095")</programlisting>
|
||||
<programlisting language="java" linenumbering="unnumbered">@AutoConfigureStubRunner(repositoryRoot="https://foo.bar", ids = "com.example:beer-api-producer:+:stubs:8095")</programlisting>
|
||||
</section>
|
||||
<section xml:id="_classpath_scanning">
|
||||
<title>Classpath scanning</title>
|
||||
@@ -3793,7 +3793,7 @@ $ java -jar stub-runner.jar --stubrunner.ids=... --stubrunner.repositoryRoot=...
|
||||
</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>
|
||||
<simpara>Starting from <literal>1.4.0.RELEASE</literal> version of the <link xl:href="https://cloud.spring.io/spring-cloud-cli">Spring Cloud CLI</link>
|
||||
project you can start Stub Runner Boot by executing <literal>spring cloud stubrunner</literal>.</simpara>
|
||||
<simpara>In order to pass the configuration just create a <literal>stubrunner.yml</literal> file in the current working directory
|
||||
or a subdirectory called <literal>config</literal> or in <literal>~/.spring-cloud</literal>. The file could look like this
|
||||
@@ -3959,7 +3959,7 @@ and we want to have the stub runner feature turned on <literal>@AutoConfigureStu
|
||||
<simpara>Now let’s assume that we want to start this application so that the stubs get automatically registered.
|
||||
We can do it by running the app <literal>java -jar ${SYSTEM_PROPS} stub-runner-boot-eureka-example.jar</literal> where
|
||||
<literal>${SYSTEM_PROPS}</literal> would contain the following list of properties</simpara>
|
||||
<programlisting language="bash" linenumbering="unnumbered">-Dstubrunner.repositoryRoot=http://repo.spring.io/snapshots (1)
|
||||
<programlisting language="bash" linenumbering="unnumbered">-Dstubrunner.repositoryRoot=https://repo.spring.io/snapshots (1)
|
||||
-Dstubrunner.cloud.stubbed.discovery.enabled=false (2)
|
||||
-Dstubrunner.ids=org.springframework.cloud.contract.verifier.stubs:loanIssuance,org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer,org.springframework.cloud.contract.verifier.stubs:bootService (3)
|
||||
-Dstubrunner.idsToServiceIds.fraudDetectionServer=someNameThatShouldMapFraudDetectionServer (4)
|
||||
@@ -4912,7 +4912,7 @@ the <literal>Contract</literal> class: <literal>import org.springframework.cloud
|
||||
"id":"01fbe706f872cb32",
|
||||
"name":"Washington",
|
||||
"place_type":"city",
|
||||
"url": "http://api.twitter.com/1/geo/id/01fbe706f872cb32.json"
|
||||
"url": "https://api.twitter.com/1/geo/id/01fbe706f872cb32.json"
|
||||
}
|
||||
}]
|
||||
'''
|
||||
@@ -6082,7 +6082,7 @@ matches the JSON Path.</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<simpara>If you’re using the YAML contract definition you have to use the
|
||||
<link xl:href="http://handlebarsjs.com/">Handlebars</link> <literal>{{{ }}}</literal> notation with custom, Spring Cloud Contract
|
||||
<link xl:href="https://handlebarsjs.com/">Handlebars</link> <literal>{{{ }}}</literal> notation with custom, Spring Cloud Contract
|
||||
functions to achieve this.</simpara>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
@@ -8280,7 +8280,7 @@ public class WiremockForDocsMockServerApplicationTests {
|
||||
public void contextLoads() throws Exception {
|
||||
// will read stubs classpath
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate)
|
||||
.baseUrl("http://example.org").stubs("classpath:/stubs/resource.json")
|
||||
.baseUrl("https://example.org").stubs("classpath:/stubs/resource.json")
|
||||
.build();
|
||||
// We're asserting if WireMock responded properly
|
||||
assertThat(this.service.go()).isEqualTo("Hello World");
|
||||
@@ -8290,7 +8290,7 @@ public class WiremockForDocsMockServerApplicationTests {
|
||||
<simpara>The <literal>baseUrl</literal> value is prepended to all mock calls, and the <literal>stubs()</literal> method takes a stub
|
||||
path resource pattern as an argument. In the preceding example, the stub defined at
|
||||
<literal>/stubs/resource.json</literal> is loaded into the mock server. If the <literal>RestTemplate</literal> is asked to
|
||||
visit <literal><link xl:href="http://example.org/">http://example.org/</link></literal>, it gets the responses as being declared at that URL. More
|
||||
visit <literal><link xl:href="https://example.org/">https://example.org/</link></literal>, it gets the responses as being declared at that URL. More
|
||||
than one stub pattern can be specified, and each one can be a directory (for a recursive
|
||||
list of all ".json"), a fixed filename (as in the example above), or an Ant-style
|
||||
pattern. The JSON format is the normal WireMock format, which you can read about in the
|
||||
@@ -8556,7 +8556,7 @@ structure presented in the previous snippet.</simpara>
|
||||
<assembly
|
||||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd">
|
||||
<id>stubs</id>
|
||||
<formats>
|
||||
<format>jar</format>
|
||||
|
||||
Reference in New Issue
Block a user