* Upgraded pact-jvm-model to 3.5.13
* Enhanced the conversion of Spring Cloud contracts to Pact contracts using the v3 spec.
Introduces breaking change returning a list of `Pact`s instead of one.
* Enhanced the conversion of Pact contracts using the v3 spec tp Spring Cloud contracts.
* Implemented conversion of Pact v3 messaging to/from Spring Cloud contracts
* Updated code based on comments in the PR
* Added null matcher
* Added missing null matcher conversion from SCC to Pact
* Added number, integer and decimal matchers
* Added support for multiple matchers for the same json path.
Currently only the AND rule logic is supported.
* Added value generator functionality
* Refactored `stubMatchers` and `testMatchers` to support multiple types of "matcher groups", eg. header, path & query
* Refactored e37a8c5d82f96da6e1a698331afc62e6cf747bd6 in favor of a less invasive change using deprecation
* Added header matcher conversion
* Add/updated the ASF license header
* Fixed an issue with the header matchers while updating the documentation
* Updated the documentation
* Made some last minute changes to the `bodyMatchers`: `byNull()` isn't supported by WireMock
Closes#583Fixes#595
when stubsMode is set to LOCAL or REMOTE, and repositoryRoot starts with git:// we can clone the provided git repository, and search for the folder with stubs for the given artifact. So if the git repo has a folder structure of groupid/artifactid/version (where group id is either dot or slash separated), then we will provide a path to that repository for the stub runner to harvest the stubs
- externalized versions
- added more debugging messages
- added ContractProjectUpdater that updates the project containing contracts from SCM. ATM supports only git
- added ResourceResolver that retrieves the ProtocolResolvers. It does it via spring.factories entries containing StubDownloaderBuilder. SDP extends ProtocolResovler.
added StubRunner.properties map, that will contain any properties that will be later used by any StubDownloader implementations
- added PUBLISH_STUBS_TO_SCM env var for Docker, so that publishStubsToScm task gets called
- updated docs
Breaking:
- StubDownloaderBuilder extends ProtocolResovler. By default the ProtocolResolver methods return null.
- stubRunnerOptions.stubRepositoryRoot is a Resource not a String
- generateWireMockClientStubs Gradle task got removed
- if folder with contracts has a subfolder called contracts, we will pick contracts from the subfolder
fixes#580
These environment variables are used when contracts lay in an external repository. To enable
this feature you must set the `EXTERNAL_CONTRACTS_ARTIFACT_ID` environment variable.
- `EXTERNAL_CONTRACTS_GROUP_ID` - group id of the project with contracts. Defaults to `com.example`
- `EXTERNAL_CONTRACTS_ARTIFACT_ID`- artifact id of the project with contracts.
- `EXTERNAL_CONTRACTS_CLASSIFIER`- classifier of the project with contracts. Empty by default
- `EXTERNAL_CONTRACTS_VERSION` - version of the project with contracts. Defaults to `+`, equivalent to picking the latest
- `EXTERNAL_CONTRACTS_REPO_WITH_BINARIES_URL` - URL of your Artifact Manager. Defaults to value of `REPO_WITH_BINARIES_URL` env var.
If that's not set, defaults to `http://localhost:8081/artifactory/libs-release-local`
which is the default URL of https://jfrog.com/artifactory/[Artifactory] running locally
- `EXTERNAL_CONTRACTS_PATH` - path to contracts for the given project, inside the project with contracts.
Defaults to slash separated `EXTERNAL_CONTRACTS_GROUP_ID` concatenated with `/` and `EXTERNAL_CONTRACTS_ARTIFACT_ID`. E.g.
for group id `foo.bar` and artifact id `baz`, would result in `foo/bar/baz` contracts path.
- `EXTERNAL_CONTRACTS_WORK_OFFLINE` - if set to `true` then will retrieve artifact with contracts
from the container's `.m2`. Mount your local `.m2` as a volume available at the container's `/root/.m2` path.
You must not set both `EXTERNAL_CONTRACTS_WORK_OFFLINE` and `EXTERNAL_CONTRACTS_REPO_WITH_BINARIES_URL`.
fixes gh-576
with this change there are numerous helper methods that should provide a more descriptive DSL for the response status. Instead of a numerical status you can now call a method e.g. instead of 200 call OK()
fixes gh-575
The bug is related to the fact that initially, we were supporting slash-separated paths to projects. E.g. if the group id was `a.b.c` then we did checked for `a/b/c` folder. At certain point we've started building stubs with the `groupid` folder as such e.g. `a.b.c/artifact-id`. This is where the bug comes in. For Maven and Gradle we're using ant patterns for copying files. We're only providing the slash-separated ant pattern. With this fix, we're backward compatible (we're leaving the slash-separated one) and we're adding support for dot-delimited group id.
fixes gh-555
The bug is related to the fact that initially, we were supporting slash-separated paths to projects. E.g. if the group id was `a.b.c` then we did checked for `a/b/c` folder. At certain point we've started building stubs with the `groupid` folder as such e.g. `a.b.c/artifact-id`. This is where the bug comes in. For Maven and Gradle we're using ant patterns for copying files. We're only providing the slash-separated ant pattern. With this fix, we're backward compatible (we're leaving the slash-separated one) and we're adding support for dot-delimited group id.
fixes gh-555
Olga Maciaszek-Sharma added very nice content, in the form of a three-second and a three-minute introduction for the verifier. I edited her additions to conform to our usual standards and corporate voice.
* Fix links to contract-dsl section.
* Add three second tour.
* Add consumer side info in the three second tour.
* Add three-minute tour.
* Generate readme changes.
When fetching stubs / contracts in a CI, shared environment, what might happen is that
both the producer and the consumer reuse the same local Maven repository. Due to this,
the framework, responsible for downloading a stub JAR from remote location,
can't decide which JAR should be picked, local or remote one. That caused
the `"The artifact was found in the local repository but you have explicitly
stated that it should be downloaded from a remote one"` exception
and failed the build.
For such cases we're introducing the property mechanism:
- via `stubrunner.snapshot-check.skip` system property
- via `STUBRUNNER_SNAPSHOT_CHECK_SKIP` environment variable
if either of these values is set to `true`, then the stub downloader will not
verify the origin of the downloaded JAR.
fixes gh-545
with this change we're adding generation of 2 docker images - verifier and stub runner
we also added a project `spring-cloud-contract-stub-runner-boot` which contains a far jar with stub runner boot
fixes gh-526, gh-516
* Draft support for WebTestClient
* Share some common code between MockMvc and WebTestClient
* Fix co-ordinates of server stubs
* Fix project names in Gradle
* Introduces explicit mode of stub downloading
you have to explicitly provide the mode [CLASSPATH, REMOTE, LOCAL] of how you want to fetch and register stubs
fixes gh-287