Convert Contract Definitions to YAML (#827)
without this change, if you're using some external libraries and you reference them in your DSL, those libraries need to also be used on the consumer side. with this change, you can set the contractsToYaml property of the plugin, that will convert the contract definitions into YAML, and then generate tests and stubs. We will store the original contract definitions under the originals folder. fixes #744
This commit is contained in:
committed by
GitHub
parent
6901fe03f5
commit
59e5f8b1eb
@@ -1499,6 +1499,8 @@ You can now reference your classes in your DSL, as shown in the following exampl
|
||||
include::{samples_url}/producer/src/test/resources/contracts/beer/rest/shouldGrantABeerIfOldEnough.groovy[indent=0]
|
||||
----
|
||||
|
||||
IMPORTANT: You can set the Spring Cloud Contract plugin up by setting `convertToYaml` to `true`. That way you will NOT have to add the dependency with the extended functionality to the consumer side, since the consumer side will be using YAML contracts instead of Groovy ones.
|
||||
|
||||
== Using the Pluggable Architecture
|
||||
|
||||
You may encounter cases where you have your contracts have been defined in other formats,
|
||||
|
||||
@@ -268,6 +268,11 @@ JAR is available offline, remotely etc.)
|
||||
* *deleteStubsAfterTest*: If set to `false` will not remove any downloaded
|
||||
contracts from temporary directories
|
||||
|
||||
Below you can find a list of experimental features you can turn on via the plugin:
|
||||
|
||||
* *convertToYaml*: converts all DSLs to the declarative, YAML format. This can be extremely useful when you're using external libraries in your Groovy DSLs. By turning this feature on (by setting it to `true`) you will not need to add the library dependency on the consumer side.
|
||||
* *assertJsonSize*: You can check the size of JSON arrays in the generated tests. This feature is disabled by default.
|
||||
|
||||
[[gradle-single-base-class]]
|
||||
==== Single Base Class for All Tests
|
||||
|
||||
@@ -628,6 +633,11 @@ use the current Maven ones.
|
||||
We cache only non-snapshot, explicitly provided versions (for example
|
||||
`+` or `1.0.0.BUILD-SNAPSHOT` won't get cached). By default, this feature is turned on.
|
||||
|
||||
Below you can find a list of experimental features you can turn on via the plugin:
|
||||
|
||||
* *convertToYaml*: converts all DSLs to the declarative, YAML format. This can be extremely useful when you're using external libraries in your Groovy DSLs. By turning this feature on (by setting it to `true`) you will not need to add the library dependency on the consumer side.
|
||||
* *assertJsonSize*: You can check the size of JSON arrays in the generated tests. This feature is disabled by default.
|
||||
|
||||
[[maven-single-base]]
|
||||
==== Single Base Class for All Tests
|
||||
|
||||
|
||||
Reference in New Issue
Block a user