Merge branch '2.1.x'
# Conflicts: # README.adoc
This commit is contained in:
@@ -17,7 +17,7 @@ producers and consumers -- for both HTTP and message-based interactions.
|
||||
|
||||
If you prefer to learn about the project by doing some tutorials, you can check out the
|
||||
workshops under
|
||||
http://cloud-samples.spring.io/spring-cloud-contract-samples/workshops.html[this link].
|
||||
https://cloud-samples.spring.io/spring-cloud-contract-samples/workshops.html[this link].
|
||||
|
||||
=== Spring Cloud Contract Verifier
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ structure presented in the previous snippet.
|
||||
<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>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
== Spring Cloud Contract WireMock
|
||||
|
||||
The Spring Cloud Contract WireMock modules let you use http://wiremock.org[WireMock] in a
|
||||
The Spring Cloud Contract WireMock modules let you use https://github.com/tomakehurst/wiremock[WireMock] in a
|
||||
Spring Boot application. Check out the
|
||||
https://github.com/spring-cloud/spring-cloud-contract/tree/{branch}/samples[samples]
|
||||
for more details.
|
||||
@@ -160,11 +160,11 @@ include::{doc_samples}/src/test/java/com/example/WiremockForDocsMockServerApplic
|
||||
The `baseUrl` value is prepended to all mock calls, and the `stubs()` method takes a stub
|
||||
path resource pattern as an argument. In the preceding example, the stub defined at
|
||||
`/stubs/resource.json` is loaded into the mock server. If the `RestTemplate` is asked to
|
||||
visit `http://example.org/`, it gets the responses as being declared at that URL. More
|
||||
visit `https://example.org/`, 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
|
||||
http://wiremock.org/docs/stubbing/[WireMock website].
|
||||
https://wiremock.org/docs/stubbing/[WireMock website].
|
||||
|
||||
Currently, the Spring Cloud Contract Verifier supports Tomcat, Jetty, and Undertow as
|
||||
Spring Boot embedded servers, and Wiremock itself has "native" support for a particular
|
||||
|
||||
@@ -640,7 +640,7 @@ given name.
|
||||
matches the JSON Path.
|
||||
|
||||
If you're using the YAML contract definition you have to use the
|
||||
http://handlebarsjs.com/[Handlebars] `{{{ }}}` notation with custom, Spring Cloud Contract
|
||||
https://handlebarsjs.com/[Handlebars] `{{{ }}}` notation with custom, Spring Cloud Contract
|
||||
functions to achieve this.
|
||||
|
||||
* `{{{ request.url }}}`: Returns the request URL and query parameters.
|
||||
|
||||
@@ -164,7 +164,7 @@ org.springframework.cloud.contract.spec.Contract.make {
|
||||
}
|
||||
----
|
||||
|
||||
IMPORTANT: Please read the http://groovy-lang.org/json.html[Groovy docs related to JSON] to understand how to
|
||||
IMPORTANT: Please read the https://groovy-lang.org/json.html[Groovy docs related to JSON] to understand how to
|
||||
properly structure the request / response bodies.
|
||||
|
||||
=== How to do Stubs versioning?
|
||||
@@ -316,7 +316,7 @@ When the *consumer* wants to work on the contracts offline, instead of cloning t
|
||||
consumer team clones the common repository, goes to the required producer's folder (e.g. `com/example/server`)
|
||||
and runs `mvn clean install -DskipTests` to install locally the stubs converted from the contracts.
|
||||
|
||||
TIP: You need to have http://maven.apache.org/download.cgi[Maven installed locally]
|
||||
TIP: You need to have https://maven.apache.org/download.cgi[Maven installed locally]
|
||||
|
||||
==== Producer
|
||||
|
||||
@@ -690,7 +690,7 @@ to find stub definitions and contracts. E.g. for `com.example:foo:1.0.0` the pat
|
||||
|
||||
=== Can I use the Pact Broker?
|
||||
|
||||
When using http://pact.io/[Pact] you can use the https://github.com/pact-foundation/pact_broker[Pact Broker]
|
||||
When using https://pact.io/[Pact] you can use the https://github.com/pact-foundation/pact_broker[Pact Broker]
|
||||
to store and share Pact definitions. Starting from Spring Cloud Contract
|
||||
2.0.0 one can fetch Pact files from the Pact Broker to generate
|
||||
tests and stubs.
|
||||
|
||||
@@ -20,7 +20,7 @@ Spring Cloud Contract Verifier.
|
||||
|
||||
Before becoming Spring Cloud Contract, this project was called https://github.com/Codearte/accurest[Accurest].
|
||||
It was created by https://twitter.com/mgrzejszczak[Marcin Grzejszczak] and https://twitter.com/jkubrynski[Jakub Kubrynski]
|
||||
from (http://codearte.io[codearte.io].
|
||||
from (https://github.com/Codearte[Codearte].
|
||||
|
||||
The `0.1.0` release took place on 26 Jan 2015 and it became stable with `1.0.0` release on 29 Feb 2016.
|
||||
|
||||
@@ -732,7 +732,7 @@ a map notation or String with interpolations.
|
||||
Consult the <<contract-dsl>> section for more information. We highly recommend using the map notation!
|
||||
|
||||
TIP: You must understand the map notation in order to set up contracts. Please read the
|
||||
http://groovy-lang.org/json.html[Groovy docs regarding JSON].
|
||||
https://groovy-lang.org/json.html[Groovy docs regarding JSON].
|
||||
|
||||
The previously shown contract is an agreement between two sides that:
|
||||
|
||||
@@ -911,7 +911,7 @@ the `contracts` folder, pick only one, which should be `fraud`. Add the `Base` s
|
||||
capitalize `fraud`. That gives you the `FraudBase` test class name.
|
||||
|
||||
All the generated tests extend that class. Over there, you can set up your Spring Context
|
||||
or whatever is necessary. In this case, use http://rest-assured.io/[Rest Assured MVC] to
|
||||
or whatever is necessary. In this case, use https://github.com/rest-assured/rest-assured[Rest Assured MVC] to
|
||||
start the server side `FraudDetectionController`.
|
||||
|
||||
[source,java,indent=0]
|
||||
@@ -1045,10 +1045,10 @@ video::sAAklvxmPmk[youtube,start=538,width=640,height=480]
|
||||
|
||||
==== Readings
|
||||
|
||||
- http://www.slideshare.net/MarcinGrzejszczak/stick-to-the-rules-consumer-driven-contracts-201507-confitura[Slides from Marcin Grzejszczak's talk about Accurest]
|
||||
- http://toomuchcoding.com/blog/categories/accurest/[Accurest related articles from Marcin Grzejszczak's blog]
|
||||
- http://toomuchcoding.com/blog/categories/spring-cloud-contract/[Spring Cloud Contract related articles from Marcin Grzejszczak's blog]
|
||||
- http://groovy-lang.org/json.html[Groovy docs regarding JSON]
|
||||
- https://www.slideshare.net/MarcinGrzejszczak/stick-to-the-rules-consumer-driven-contracts-201507-confitura[Slides from Marcin Grzejszczak's talk about Accurest]
|
||||
- https://toomuchcoding.com/blog/categories/accurest/[Accurest related articles from Marcin Grzejszczak's blog]
|
||||
- https://toomuchcoding.com/blog/categories/spring-cloud-contract/[Spring Cloud Contract related articles from Marcin Grzejszczak's blog]
|
||||
- https://groovy-lang.org/json.html[Groovy docs regarding JSON]
|
||||
|
||||
=== Samples
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ In order to use Spring Cloud Contract Verifier with WireMock, you muse use eithe
|
||||
Gradle or a Maven plugin.
|
||||
|
||||
WARNING: If you want to use Spock in your projects, you must add separately the
|
||||
`spock-core` and `spock-spring` modules. Check http://spockframework.github.io/[Spock
|
||||
`spock-core` and `spock-spring` modules. Check https://spockframework.github.io/[Spock
|
||||
docs for more information]
|
||||
|
||||
[[gradle-add-gradle-plugin]]
|
||||
@@ -1007,7 +1007,7 @@ name of `scenario1` and the three following steps:
|
||||
. logout marked as `Step2` which will close the scenario.
|
||||
|
||||
More details about WireMock scenarios can be found at
|
||||
http://wiremock.org/docs/stateful-behaviour/[http://wiremock.org/docs/stateful-behaviour/]
|
||||
https://wiremock.org/docs/stateful-behaviour/[https://wiremock.org/docs/stateful-behaviour/]
|
||||
|
||||
Spring Cloud Contract Verifier also generates tests with a guaranteed order of execution.
|
||||
|
||||
@@ -1059,7 +1059,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 https://jfrog.com/artifactory/[Artifactory]
|
||||
or http://www.sonatype.org/nexus/[Nexus].
|
||||
or https://www.sonatype.org/nexus/[Nexus].
|
||||
|
||||
==== How it works
|
||||
|
||||
@@ -1073,7 +1073,7 @@ It's enough for you to mount your contracts, pass the environment variables
|
||||
|
||||
- generate the contract tests
|
||||
- execute the tests against the provided URL
|
||||
- generate the http://wiremock.org[WireMock] stubs
|
||||
- generate the https://github.com/tomakehurst/wiremock[WireMock] stubs
|
||||
- (optional - turned on by default) publish the stubs to a Artifact Manager
|
||||
|
||||
===== Environment Variables
|
||||
|
||||
Reference in New Issue
Block a user