Fix more URLs.
# Conflicts: # docs/src/main/asciidoc/verifier_setup.adoc
This commit is contained in:
@@ -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.
|
||||
@@ -164,7 +164,7 @@ visit `https://example.org/`, it gets the responses as being declared at that UR
|
||||
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
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -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]
|
||||
@@ -1046,9 +1046,9 @@ video::sAAklvxmPmk[youtube,start=538,width=640,height=480]
|
||||
==== Readings
|
||||
|
||||
- https://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://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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#WireMock password - http://wiremock.org/docs/running-standalone/
|
||||
#WireMock password - https://wiremock.org/docs/running-standalone/
|
||||
server.ssl.key-store-password=password
|
||||
server.ssl.key-password=password
|
||||
server.ssl.trust-store-password=password
|
||||
|
||||
@@ -91,7 +91,7 @@ class RegexPatternsSpec extends Specification {
|
||||
'https://j.mp' || true
|
||||
'ftp://foo.bar/baz' || true
|
||||
'https://foo.bar/?q=Test%20URL-encoded%20stuff' || true
|
||||
'http://1337.net' || true
|
||||
'https://1224.net/' || true
|
||||
'https://a.b-c.de' || true
|
||||
'https://223.255.255.254' || true
|
||||
'foo.com' || true
|
||||
|
||||
@@ -64,7 +64,7 @@ public class StubRunnerMain {
|
||||
ArgumentAcceptingOptionSpec<String> rootOpt = parser.acceptsAll(
|
||||
Arrays.asList("r", "root"),
|
||||
"Location of a Jar containing server where you keep "
|
||||
+ "your stubs (e.g. http://nexus.net/content/repositories/repository)")
|
||||
+ "your stubs (e.g. https://nexus.net/content/repositories/repository)")
|
||||
.withRequiredArg();
|
||||
ArgumentAcceptingOptionSpec<String> usernameOpt = parser
|
||||
.acceptsAll(Arrays.asList("u", "username"),
|
||||
|
||||
@@ -42,7 +42,7 @@ public class StubRunnerBootEurekaExample {
|
||||
/*
|
||||
*
|
||||
* // tag::stubrunnereureka_args[]
|
||||
* -Dstubrunner.repositoryRoot=https://repo.spring.io/snapshots (1)
|
||||
* -Dstubrunner.repositoryRoot=https://repo.spring.io/snapshot (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.
|
||||
|
||||
@@ -488,7 +488,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
}
|
||||
body(
|
||||
email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
|
||||
callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
|
||||
callback_url: $(consumer(regex(hostname())), producer('https://partners.com'))
|
||||
)
|
||||
}
|
||||
response {
|
||||
@@ -543,7 +543,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
and:
|
||||
def response = restTemplate.exchange(RequestEntity.post("${url}/users/password".toURI())
|
||||
.header("Content-Type", "application/json")
|
||||
.body('''{"email":"abc@abc.com", "callback_url":"http://partners.com"}''')
|
||||
.body('''{"email":"abc@abc.com", "callback_url":"https://partners.com"}''')
|
||||
, String)
|
||||
response.headers.get('Content-Type') == ['application/json']
|
||||
response.statusCodeValue == 404
|
||||
@@ -846,7 +846,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
}
|
||||
body(
|
||||
email: 'abc@abc.com',
|
||||
callback_url: 'http://partners.com'
|
||||
callback_url: 'https://partners.com'
|
||||
)
|
||||
bodyMatchers {
|
||||
jsonPath('$.[\\'email\\']', byRegex(email()))
|
||||
@@ -908,7 +908,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
and:
|
||||
def response = restTemplate.exchange(RequestEntity.post("${url}/users/password2".toURI())
|
||||
.header("Content-Type", "application/json")
|
||||
.body('''{"email":"abc@abc.com", "callback_url":"http://partners.com"}''')
|
||||
.body('''{"email":"abc@abc.com", "callback_url":"https://partners.com"}''')
|
||||
, String)
|
||||
response.headers.get('Content-Type') == ['application/json']
|
||||
response.statusCodeValue == 404
|
||||
@@ -932,7 +932,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
}
|
||||
body(
|
||||
email: 'abc@abc.com',
|
||||
callback_url: 'http://partners.com'
|
||||
callback_url: 'https://partners.com'
|
||||
)
|
||||
bodyMatchers {
|
||||
jsonPath('$.[\\'email\\']', byRegex(email()))
|
||||
@@ -1006,7 +1006,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
and:
|
||||
def response = restTemplate.exchange(RequestEntity.post("${url}/users/password2".toURI())
|
||||
.header("Content-Type", "application/json")
|
||||
.body('''{"email":"abc@abc.com", "callback_url":"http://partners.com"}''')
|
||||
.body('''{"email":"abc@abc.com", "callback_url":"https://partners.com"}''')
|
||||
, String)
|
||||
response.headers.get('Content-Type') == ['application/json;charset=UTF-8']
|
||||
response.statusCodeValue == 400
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#WireMock password - http://wiremock.org/docs/running-standalone/
|
||||
#WireMock password - https://wiremock.org/docs/running-standalone/
|
||||
server.ssl.key-store-password=password
|
||||
server.ssl.key-password=password
|
||||
server.ssl.trust-store-password=password
|
||||
|
||||
@@ -287,7 +287,7 @@ class ContractHttpDocsSpec extends Specification {
|
||||
}
|
||||
body(
|
||||
email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
|
||||
callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
|
||||
callback_url: $(consumer(regex(hostname())), producer('https://partners.com'))
|
||||
)
|
||||
}
|
||||
response {
|
||||
@@ -315,7 +315,7 @@ class ContractHttpDocsSpec extends Specification {
|
||||
given:
|
||||
def request = given()
|
||||
.header("Content-Type", "application/json")
|
||||
.body('''{"email":"abc@abc.com","callback_url":"http://partners.com"}''')
|
||||
.body('''{"email":"abc@abc.com","callback_url":"https://partners.com"}''')
|
||||
|
||||
when:
|
||||
def response = given().spec(request)
|
||||
|
||||
@@ -1365,7 +1365,7 @@ class WireMockGroovyDslSpec extends Specification implements WireMockStubVerifie
|
||||
}
|
||||
body(
|
||||
email: $(consumer(regex(email())), producer('not.existing@user.com')),
|
||||
callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
|
||||
callback_url: $(consumer(regex(hostname())), producer('https://partners.com'))
|
||||
)
|
||||
}
|
||||
response {
|
||||
@@ -1504,7 +1504,7 @@ class WireMockGroovyDslSpec extends Specification implements WireMockStubVerifie
|
||||
}
|
||||
body(
|
||||
email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
|
||||
callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
|
||||
callback_url: $(consumer(regex(hostname())), producer('https://partners.com'))
|
||||
)
|
||||
}
|
||||
response {
|
||||
@@ -1529,7 +1529,7 @@ class WireMockGroovyDslSpec extends Specification implements WireMockStubVerifie
|
||||
body(
|
||||
""" {
|
||||
"email" : "${value(consumer(optional(regex(email()))), producer('abc@abc.com'))}",
|
||||
"callback_url" : "${value(consumer(regex(hostname())), producer('http://partners.com'))}"
|
||||
"callback_url" : "${value(consumer(regex(hostname())), producer('https://partners.com'))}"
|
||||
}
|
||||
"""
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user