Updated docs
This commit is contained in:
@@ -314,7 +314,7 @@ Spring Cloud Contract Verifier moves TDD to the level of software architecture.
|
||||
==== Spring Cloud Contract Webinar
|
||||
|
||||
You can check out the video from the Spring Cloud Contract Webinar to watch the
|
||||
explanation of the project and the concept of Spring Cloud Contract. Video was recorded
|
||||
explanation of the project and the concept of Consuner Driven Contracts. Video was recorded
|
||||
on 25.10.2016.
|
||||
|
||||
video::4fJiz0woxAc[youtube]
|
||||
|
||||
@@ -4,11 +4,17 @@ Projects that contain different samples of Spring Cloud Contract Verifier.
|
||||
|
||||
Below you can find a list of samples:
|
||||
|
||||
include::http-server/README.adoc[]
|
||||
`include::contracts/README.adoc[]
|
||||
|
||||
include::http-client/README.adoc[]
|
||||
include::dsl/http-server/README.adoc[]
|
||||
|
||||
include::contract-verifier-sample-stream-sink/README.adoc[]
|
||||
include::dsl/http-client/README.adoc[]
|
||||
|
||||
include::contract-verifier-sample-stream-source/README.adoc[]
|
||||
include::messaging/stream-sink/README.adoc[]
|
||||
|
||||
include::messaging/stream-source/README.adoc[]
|
||||
|
||||
include::restdocs/http-server/README.adoc[]
|
||||
|
||||
include::restdocs/http-client/README.adoc[]
|
||||
|
||||
|
||||
69
samples/standalone/contracts/README.adoc
Normal file
69
samples/standalone/contracts/README.adoc
Normal file
@@ -0,0 +1,69 @@
|
||||
= Common contracts repo
|
||||
|
||||
This repo contains all contracts for apps in the system.
|
||||
|
||||
== As a consumer
|
||||
|
||||
You are working offline in order to play around with the API of the producer.
|
||||
What you need to do is to have the producer's stubs installed locally. To do that
|
||||
you have to (from the root of the repo)
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
cd com/example/server/
|
||||
mvn clean install -DskipTests
|
||||
----
|
||||
|
||||
Then if you do `ls ./target` you'll see `server-0.0.1-SNAPSHOT-stubs.jar`. This jar will
|
||||
contain the stubs generated from your contracts. That way you
|
||||
can reference the `com.example:server:+:stubs` dependency in your consumer tests.
|
||||
|
||||
== As a producer
|
||||
|
||||
Assuming that the consumers have filed a PR with the proposed contract the producers
|
||||
can work offline to generate tests and stubs. To work offline, as a producer you just have
|
||||
to go to the root folder of the contracts and:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
./mvnw clean install -DskipTests
|
||||
----
|
||||
|
||||
Then if you do `ls ./target` you'll see `contracts-0.0.1-SNAPSHOT.jar`. This file contains
|
||||
all DSL contracts, for all applications.
|
||||
|
||||
Now the producer can include the `contracts-0.0.1-SNAPSHOT.jar` from your local maven repository.
|
||||
You can achieve that by setting the proper flag in plugin properties.
|
||||
|
||||
Example for Maven
|
||||
|
||||
[source,xml]
|
||||
----
|
||||
<plugin>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- url not required for working locally -->
|
||||
<contractsWorkOffline>true<contractsWorkOffline>
|
||||
<contractDependency>
|
||||
<groupId>com.example.standalone</groupId>
|
||||
<artifactId>contracts</artifactId>
|
||||
</contractDependency>
|
||||
</configuration>
|
||||
</plugin>
|
||||
----
|
||||
|
||||
and for Gradle:
|
||||
|
||||
[source,groovy]
|
||||
----
|
||||
contracts {
|
||||
targetFramework = 'Spock'
|
||||
testMode = 'JaxRsClient'
|
||||
baseClassForTests = 'org.springframework.cloud.MvcSpec'
|
||||
contractsWorkOffline = true
|
||||
contractDependency {
|
||||
stringNotation = "com.example:contracts"
|
||||
}
|
||||
}
|
||||
----
|
||||
Reference in New Issue
Block a user