Updated the docs
This commit is contained in:
@@ -9,4 +9,4 @@ jdk:
|
||||
- oraclejdk8
|
||||
|
||||
install: ./gradlew assemble -s
|
||||
script: ./gradlew check funcTest install -s --continue && jdk_switcher use oraclejdk8 && ./scripts/runTests.sh
|
||||
script: ./gradlew check install -s --continue && jdk_switcher use oraclejdk8 && ./scripts/runTests.sh
|
||||
|
||||
12
README.adoc
12
README.adoc
@@ -157,6 +157,18 @@ Spring Cloud Contract Verifier stand out on the "market" of Consumer Driven Cont
|
||||
- Stub Runner functionality - the stubs are automatically downloaded at runtime from Nexus / Artifactory
|
||||
- Spring Cloud integration - no discovery service is needed for integration tests
|
||||
|
||||
== Links
|
||||
|
||||
Here you can find interesting links related to Spring Cloud Contract Verifier:
|
||||
|
||||
- https://github.com/Codearte/accurest[Spring Cloud Contract Verifier Github Repository]
|
||||
- http://codearte.github.io/accurest[Spring Cloud Contract Verifier Documentation]
|
||||
- http://codearte.github.io/accurest/deprecated[Accurest Legacy Documentation]
|
||||
- https://codearte.github.io/accurest/#spring-cloud-contract-stub-runner[Spring Cloud Contract Stub Runner Documentation]
|
||||
- http://codearte.github.io/accurest/#stub-runner-for-messaging[Spring Cloud Contract Stub Runner Messaging Documentation]
|
||||
- https://gitter.im/Codearte/accurest[Spring Cloud Contract Verifier Gitter]
|
||||
- https://github.com/Codearte/accurest-maven-plugin[Spring Cloud Contract Verifier Maven Plugin]
|
||||
|
||||
== Documentation
|
||||
|
||||
You can read more about Spring Cloud Contract Verifier by reading the {documentation_url}[docs]
|
||||
|
||||
@@ -42,7 +42,7 @@ Add the additional snapshot repository to your build.gradle to use snapshot vers
|
||||
repositories {
|
||||
(...)
|
||||
//Required only for SNAPSHOT versions
|
||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
|
||||
maven { url "https://repo.spring.io/plugins-snapshot-local" }
|
||||
}
|
||||
----
|
||||
|
||||
@@ -91,6 +91,48 @@ Spring Cloud Contract Verifier will create test class `defaultBasePackage.MyServ
|
||||
|
||||
Plugin registers itself to be invoked before `check` task. You have nothing to do as long as you want it to be part of your build process. If you just want to generate tests please invoke `generateContractTests` task.
|
||||
|
||||
==== Default setup
|
||||
|
||||
Default Gradle Plugin setup creates the following Gradle part of the build (it's a pseudocode)
|
||||
|
||||
[source,groovy,indent=0]
|
||||
----
|
||||
contractVerifier {
|
||||
targetFramework = 'JUNIT'
|
||||
testMode = 'MockMvc'
|
||||
generatedTestSourcesDir = project.file("${project.buildDir}/generated-test-sources/contracts")
|
||||
contractsDslDir = "${project.rootDir}/src/test/resources/contracts"
|
||||
basePackageForTests = 'org.springframework.cloud.contract.verifier.tests'
|
||||
stubsOutputDir = project.file("${project.buildDir}/stubs")
|
||||
}
|
||||
|
||||
tasks.create(type: Jar, name: 'verifierStubsJar', dependsOn: 'generateWireMockClientStubs') {
|
||||
baseName = project.name
|
||||
classifier = contractVerifier.stubsSuffix
|
||||
from contractVerifier.stubsOutputDir
|
||||
}
|
||||
|
||||
project.artifacts {
|
||||
archives task
|
||||
}
|
||||
|
||||
tasks.create(type: Copy, name: 'copyContracts') {
|
||||
from contractVerifier.contractsDslDir
|
||||
into contractVerifier.stubsOutputDir
|
||||
}
|
||||
|
||||
verifierStubsJar.dependsOn 'copyContracts'
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
stubs(MavenPublication) {
|
||||
artifactId project.name
|
||||
artifact verifierStubsJar
|
||||
}
|
||||
}
|
||||
}
|
||||
----
|
||||
|
||||
==== Configure plugin
|
||||
|
||||
To change default configuration just add `contractVerifier` snippet to your Gradle config
|
||||
|
||||
@@ -9,6 +9,19 @@ One of the issues that you could have encountered while using Spring Cloud Contr
|
||||
|
||||
Copying the JSON files / setting the client side for messaging manually is out of the question.
|
||||
|
||||
=== Snapshot versions
|
||||
|
||||
Add the additional snapshot repository to your build.gradle to use snapshot versions which are automatically uploaded after every successful build:
|
||||
|
||||
[source,groovy,indent=0]
|
||||
----
|
||||
repositories {
|
||||
(...)
|
||||
//Required only for SNAPSHOT versions
|
||||
maven { url "https://repo.spring.io/libs-snapshot-local" }
|
||||
}
|
||||
----
|
||||
|
||||
=== Publishing stubs as JARs
|
||||
|
||||
The easiest approach would be to centralize the way stubs are kept. For example you can keep them as JARs in a Maven repository.
|
||||
|
||||
Reference in New Issue
Block a user