8.1.3 Test the Dependency in the Project’s Dependencies
First, add the common jar dependency as a test dependency. Because your contracts files
are available on the test resources path, the common jar classes automatically become
visible in your Groovy files. The following examples show how to test the dependency:
Maven.
-
Unresolved directive in verifier_contract.adoc - include::https://raw.githubusercontent.com/spring-cloud-samples/spring-cloud-contract-samples/master/producer/pom.xml[tags=test_dep,indent=0]
8.1.4 Test a Dependency in the Plugin’s Dependencies
Now, you must add the dependency for the plugin to reuse at runtime, as shown in the
diff --git a/1.1.x/multi/multi__spring_cloud_contract_verifier_introduction.html b/1.1.x/multi/multi__spring_cloud_contract_verifier_introduction.html
index 646ffbf533..be8e79970e 100644
--- a/1.1.x/multi/multi__spring_cloud_contract_verifier_introduction.html
+++ b/1.1.x/multi/multi__spring_cloud_contract_verifier_introduction.html
@@ -295,7 +295,7 @@ for more information. We highly recommend using the map notation!
2016-07-1914:22:25.475 INFO 41050 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Unpacked file to [/var/folders/0p/xwq47sq106x1_g3dtv6qfm940000gq/T/contracts100276532569594265]
2016-07-1914:22:27.737 INFO 41050 --- [ main] o.s.c.c.stubrunner.StubRunnerExecutor : All stubs are now running RunningStubs [namesAndPorts={com.example:http-server:0.0.1-SNAPSHOT:stubs=8080}]
Which means that Stub Runner has found your stubs and started a server for app with group id com.example, artifact id http-server with version 0.0.1-SNAPSHOT of the stubs and with stubs classifier on port 8080.
file a PR
What we did until now is an iterative process. We can play around with the contract, install it locally and work on the consumer side until we’re happy with the contract.
Once we’re satisfied with the results and the test passes publish a PR to the server side. Currently the consumer side work is done.
2.4.3 Producer side (Fraud Detection server)
As a developer of the Fraud Detection server (a server to the Loan Issuance service):
initial implementation
As a reminder here you can see the initial implementation
You have to add the dependencies needed by the autogenerated tests
<dependency><groupId>org.springframework.cloud</groupId>
diff --git a/1.1.x/single/spring-cloud-contract.html b/1.1.x/single/spring-cloud-contract.html
index bcbbbf6c4b..841e2d4fc3 100644
--- a/1.1.x/single/spring-cloud-contract.html
+++ b/1.1.x/single/spring-cloud-contract.html
@@ -299,7 +299,7 @@ for more information. We highly recommend using the map notation!
2016-07-1914:22:25.475 INFO 41050 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Unpacked file to [/var/folders/0p/xwq47sq106x1_g3dtv6qfm940000gq/T/contracts100276532569594265]
2016-07-1914:22:27.737 INFO 41050 --- [ main] o.s.c.c.stubrunner.StubRunnerExecutor : All stubs are now running RunningStubs [namesAndPorts={com.example:http-server:0.0.1-SNAPSHOT:stubs=8080}]
Which means that Stub Runner has found your stubs and started a server for app with group id com.example, artifact id http-server with version 0.0.1-SNAPSHOT of the stubs and with stubs classifier on port 8080.
file a PR
What we did until now is an iterative process. We can play around with the contract, install it locally and work on the consumer side until we’re happy with the contract.
Once we’re satisfied with the results and the test passes publish a PR to the server side. Currently the consumer side work is done.
2.4.3 Producer side (Fraud Detection server)
As a developer of the Fraud Detection server (a server to the Loan Issuance service):
initial implementation
As a reminder here you can see the initial implementation
You have to add the dependencies needed by the autogenerated tests
<dependency><groupId>org.springframework.cloud</groupId>
@@ -3321,7 +3321,12 @@ maintain the static compatibility. Later in this document, you can see examples
to pass the dependency to your project.
8.1.3 Test the Dependency in the Project’s Dependencies
First, add the common jar dependency as a test dependency. Because your contracts files
are available on the test resources path, the common jar classes automatically become
visible in your Groovy files. The following examples show how to test the dependency:
Maven.
-
Unresolved directive in verifier_contract.adoc - include::https://raw.githubusercontent.com/spring-cloud-samples/spring-cloud-contract-samples/master/producer/pom.xml[tags=test_dep,indent=0]
8.1.4 Test a Dependency in the Plugin’s Dependencies
Now, you must add the dependency for the plugin to reuse at runtime, as shown in the
diff --git a/1.1.x/spring-cloud-contract-maven-plugin/checkstyle.html b/1.1.x/spring-cloud-contract-maven-plugin/checkstyle.html
index 1e0a0a9eee..e0b0199f29 100644
--- a/1.1.x/spring-cloud-contract-maven-plugin/checkstyle.html
+++ b/1.1.x/spring-cloud-contract-maven-plugin/checkstyle.html
@@ -1,13 +1,13 @@
Version: 1.1.6.BUILD-SNAPSHOT
diff --git a/1.1.x/spring-cloud-contract.xml b/1.1.x/spring-cloud-contract.xml
index 6f5b45f06e..a35b060397 100644
--- a/1.1.x/spring-cloud-contract.xml
+++ b/1.1.x/spring-cloud-contract.xml
@@ -579,7 +579,7 @@ public class LoanApplicationServiceTests {
As a reminder here you can see the initial implementation@RequestMapping(value = "/fraudcheck", method = PUT)
public FraudCheckResult fraudCheck(@RequestBody FraudCheck fraudCheck) {
-Unresolved directive in verifier_introduction.adoc - include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/master/samples/standalone/dsl/http-server/src/main/java/com/example/fraud/FraudDetectionController.java[tags=initial_impl,indent=0]
+return new FraudCheckResult(FraudCheckStatus.OK, NO_REASON);
}take over the PRgit checkout -b contract-change-pr master
@@ -5322,7 +5322,12 @@ visible in your Groovy files. The following examples show how to test the depend
Maven
-Unresolved directive in verifier_contract.adoc - include::https://raw.githubusercontent.com/spring-cloud-samples/spring-cloud-contract-samples/master/producer/pom.xml[tags=test_dep,indent=0]
+<dependency>
+ <groupId>com.example</groupId>
+ <artifactId>beer-common</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+</dependency>