From 400ce44917d50267cb00fd1d641390f3c8ac1df6 Mon Sep 17 00:00:00 2001
From: buildmaster
Consider following example of a Pact contract, which is a file under the +the given format will be skipped and the ISO format will be used.
In order to properly support the Spring Cloud Contract way of doing messaging +with Pact you’ll have to provide some additional meta data entries. Below you can find a list of such entries:
metaData entry in the Pact file, with key sentTo equal to the destination to which a message is to be sent. E.g. "metaData": { "sentTo": "activemq:output" }Consider following example of a Pact contract, which is a file under the
src/test/resources/contracts folder.
{
"provider": {
"name": "Provider"
@@ -438,10 +440,10 @@ to clone the repository and use it as a source of contracts
to generate tests or stubs.Either via environment variables, system properties, properties set
inside the plugin or contracts repository configuration you can
tweak the downloader’s behaviour. Below you can find the list of
-properties
Table 10.1. SCM Stub Downloader properties
Type of a property
Name of the property
Description
* git.branch (plugin prop)
* stubrunner.properties.git.branch (system prop)
* STUBRUNNER_PROPERTIES_GIT_BRANCH (env prop)
master
Which branch to checkout
* git.username (plugin prop)
* stubrunner.properties.git.username (system prop)
* STUBRUNNER_PROPERTIES_GIT_USERNAME (env prop)
Git clone username
* git.password (plugin prop)
* stubrunner.properties.git.password (system prop)
* STUBRUNNER_PROPERTIES_GIT_PASSWORD (env prop)
Git clone password
* git.no-of-attempts (plugin prop)
* stubrunner.properties.git.no-of-attempts (system prop)
* STUBRUNNER_PROPERTIES_GIT_NO_OF_ATTEMPTS (env prop)
10
Number of attempts to push the commits to origin
* git.wait-between-attempts (Plugin prop)
* stubrunner.properties.git.wait-between-attempts (system prop)
* STUBRUNNER_PROPERTIES_GIT_WAIT_BETWEEN_ATTEMPTS (env prop)
1000
Number of millis to wait between attempts to push the commits to origin
Whenever the repositoryRoot starts with a Pact protocol
+properties
Table 10.1. SCM Stub Downloader properties
Type of a property | Name of the property | Description |
* * * | master | Which branch to checkout |
* * * | Git clone username | |
* * * | Git clone password | |
* * * | 10 | Number of attempts to push the commits to |
* * * | 1000 | Number of millis to wait between attempts to push the commits to |
Whenever the repositoryRoot starts with a Pact protocol
(starts with pact://), the stub downloader will try
to fetch the Pact contract definitions from the Pact Broker.
Whatever is set after pact:// will be parsed as the Pact Broker URL.
Either via environment variables, system properties, properties set inside the plugin or contracts repository configuration you can tweak the downloader’s behaviour. Below you can find the list of -properties
Table 10.2. SCM Stub Downloader properties
Name of a property | Default | Description |
* * * | Host from URL passed to | What is the URL of Pact Broker |
* * * | Port from URL passed to | What is the port of Pact Broker |
* * * | Protocol from URL passed to | What is the protocol of Pact Broker |
* * * | Version of the stub, or | What tags should be used to fetch the stub |
* * * |
| What kind of authentication should be used to connect to the Pact Broker |
* * * | The username passed to | Username used to connect to the Pact Broker |
* * * | The password passed to | Password used to connect to the Pact Broker |
* * * | false | When |