From 23420d7da8d2cb251a5d18b0a73fdf7a5a568437 Mon Sep 17 00:00:00 2001
From: buildmaster Please read the Groovy docs related to JSON to understand how to
+} Please read the Groovy docs related to JSON to understand how to
properly structure the request / response bodies. Let’s try to answer a question what versioning really means. If you’re referring to the API version then there are
different approaches. I will not try to answer a question which approach is better. Whatever suits your needs and allows you to generate
business value should be picked. Let’s assume that you do version your API. In that case you should provide as many contracts as many versions you support.
diff --git a/2.1.x/multi/multi__spring_cloud_contract_stub_runner.html b/2.1.x/multi/multi__spring_cloud_contract_stub_runner.html
index 668ecc65ad..fcf0d6b529 100644
--- a/2.1.x/multi/multi__spring_cloud_contract_stub_runner.html
+++ b/2.1.x/multi/multi__spring_cloud_contract_stub_runner.html
@@ -761,7 +761,7 @@ the Stub Runner server. It will be available at port As you can see we want to start a Stub Runner Boot server 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 Before becoming Spring Cloud Contract, this project was called Accurest.
It was created by Marcin Grzejszczak and Jakub Kubrynski
-from (codearte.io. The Assume that we have a system consisting of multiple microservices: If we wanted to test the application in top left corner to determine whether it can
+from (Codearte. The Assume that we have a system consisting of multiple microservices: If we wanted to test the application in top left corner to determine whether it can
communicate with other services, we could do one of two things: Both have their advantages but also a lot of disadvantages. Deploy all microservices and perform end to end tests Advantages: Disadvantages: Mock other microservices in unit/integration tests Advantages: Disadvantages: You must understand the map notation in order to set up contracts. Please read the
-Groovy docs regarding JSON. The previously shown contract is an agreement between two sides that: if an HTTP request is sent with all of The previously shown contract is an agreement between two sides that: if an HTTP request is sent with all of then an HTTP response is sent to the consumer that Once you are ready to check the API in practice in the integration tests, you need to
install the stubs locally. Add the Spring Cloud Contract Verifier plugin. We can add either a Maven or a Gradle plugin. In this example, you see how to add Maven.
@@ -742,7 +742,7 @@ make the name of the base test class. In our case, the contracts were placed und
All the generated tests extend that class. Over there, you can set up your Spring Context
-or whatever is necessary. In this case, use Rest Assured MVC to
+or whatever is necessary. In this case, use Rest Assured MVC to
start the server side ![[Important]](images/important.png)
Important ![[Important]](images/important.png)
Important 8750<
}@EnableStubRunnerServer, enable Eureka client @EnableEurekaClient
and we want to have the stub runner feature turned on @AutoConfigureStubRunner.java -jar ${SYSTEM_PROPS} stub-runner-boot-eureka-example.jar where
- ${SYSTEM_PROPS} would contain the following list of properties* -Dstubrunner.repositoryRoot=https://repo.spring.io/snapshots (1)
+
${SYSTEM_PROPS} would contain the following list of properties* -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.
diff --git a/2.1.x/multi/multi__spring_cloud_contract_verifier_introduction.html b/2.1.x/multi/multi__spring_cloud_contract_verifier_introduction.html
index 263549d427..06a5e4824c 100644
--- a/2.1.x/multi/multi__spring_cloud_contract_verifier_introduction.html
+++ b/2.1.x/multi/multi__spring_cloud_contract_verifier_introduction.html
@@ -10,7 +10,7 @@ own integrations.
0.1.0 release took place on 26 Jan 2015 and it became stable with 1.0.0 release on 29 Feb 2016.
0.1.0 release took place on 26 Jan 2015 and it became stable with 1.0.0 release on 29 Feb 2016.
![[Tip]](images/tip.png)
Tip PUT method on the /fraudcheck endpoint,client.id that matches the regular expression [0-9]{10} and
+Groovy docs regarding JSON.PUT method on the /fraudcheck endpoint,client.id that matches the regular expression [0-9]{10} and
loanAmount equal to 99999,Content-Type header with a value of application/vnd.fraud.v1+json,200,fraudCheckStatus field containing a value FRAUD and
the rejectionReason field having value Amount too high,Content-Type header with a value of application/vnd.fraud.v1+json.src/test/resources/contracts/fraud. Since you do not have two packages starting from
the contracts folder, pick only one, which should be fraud. Add the Base suffix and
capitalize fraud. That gives you the FraudBase test class name.FraudDetectionController./*
* Copyright 2013-2019 the original author or authors.
*
@@ -839,5 +839,5 @@ achieving the same thing by changing the properties.
repositoryRoot: https://repo.spring.io/libs-snapshot
That’s it!
The best way to add dependencies is to use the proper starter dependency.
For stub-runner, use spring-cloud-starter-stub-runner. When you use a plugin, add
spring-cloud-starter-contract-verifier.
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.
You can check out the video from the Warsaw JUG about Spring Cloud Contract:
You can find some samples at +constant development.
You can check out the video from the Warsaw JUG about Spring Cloud Contract:
You can find some samples at samples.