From 769e38bd98b1ad2c5566b4d667ef107b73933dc8 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Mon, 3 Dec 2018 14:38:34 +0100 Subject: [PATCH] Sync docs from master to gh-pages --- ...lti__using_the_pluggable_architecture.html | 4 +- multi/multi_contract-dsl.html | 117 ++++++++++++++++- single/spring-cloud-contract.html | 121 ++++++++++++++++- .../checkstyle.rss | 8 +- spring-cloud-contract.xml | 123 +++++++++++++++++- 5 files changed, 358 insertions(+), 15 deletions(-) diff --git a/multi/multi__using_the_pluggable_architecture.html b/multi/multi__using_the_pluggable_architecture.html index afac28175f..8e786b74af 100644 --- a/multi/multi__using_the_pluggable_architecture.html +++ b/multi/multi__using_the_pluggable_architecture.html @@ -422,10 +422,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


10.7 Using the Pact Stub Downloader

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

* 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


10.7 Using the Pact Stub Downloader

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

* pactbroker.host (plugin prop)

* stubrunner.properties.pactbroker.host (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_HOST (env prop)

Host from URL passed to repositoryRoot

What is the URL of Pact Broker

* pactbroker.port (plugin prop)

* stubrunner.properties.pactbroker.port (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PORT (env prop)

Port from URL passed to repositoryRoot

What is the port of Pact Broker

* pactbroker.protocol (plugin prop)

* stubrunner.properties.pactbroker.protocol (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PROTOCOL (env prop)

Protocol from URL passed to repositoryRoot

What is the protocol of Pact Broker

* pactbroker.tags (plugin prop)

* stubrunner.properties.pactbroker.tags (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_TAGS (env prop)

Version of the stub, or latest if version is +

What tags should be used to fetch the stub

* pactbroker.auth.scheme (plugin prop)

* stubrunner.properties.pactbroker.auth.scheme (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_SCHEME (env prop)

Basic

What kind of authentication should be used to connect to the Pact Broker

* pactbroker.auth.username (plugin prop)

* stubrunner.properties.pactbroker.auth.username (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_USERNAME (env prop)

The username passed to contractsRepositoryUsername (maven) or contractRepository.username (gradle)

Username used to connect to the Pact Broker

* pactbroker.auth.password (plugin prop)

* stubrunner.properties.pactbroker.auth.password (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_PASSWORD (env prop)

The password passed to contractsRepositoryPassword (maven) or contractRepository.password (gradle)

Password used to connect to the Pact Broker

* pactbroker.provider-name-with-group-id (plugin prop)

* stubrunner.properties.pactbroker.provider-name-with-group-id (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PROVIDER_NAME_WITH_GROUP_ID (env prop)

false

When true, the provider name will be a combination of groupId:artifactId. If false, just artifactId is used


\ No newline at end of file +properties

Table 10.2. SCM Stub Downloader properties

Name of a property

Default

Description

* pactbroker.host (plugin prop)

* stubrunner.properties.pactbroker.host (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_HOST (env prop)

Host from URL passed to repositoryRoot

What is the URL of Pact Broker

* pactbroker.port (plugin prop)

* stubrunner.properties.pactbroker.port (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PORT (env prop)

Port from URL passed to repositoryRoot

What is the port of Pact Broker

* pactbroker.protocol (plugin prop)

* stubrunner.properties.pactbroker.protocol (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PROTOCOL (env prop)

Protocol from URL passed to repositoryRoot

What is the protocol of Pact Broker

* pactbroker.tags (plugin prop)

* stubrunner.properties.pactbroker.tags (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_TAGS (env prop)

Version of the stub, or latest if version is +

What tags should be used to fetch the stub

* pactbroker.auth.scheme (plugin prop)

* stubrunner.properties.pactbroker.auth.scheme (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_SCHEME (env prop)

Basic

What kind of authentication should be used to connect to the Pact Broker

* pactbroker.auth.username (plugin prop)

* stubrunner.properties.pactbroker.auth.username (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_USERNAME (env prop)

The username passed to contractsRepositoryUsername (maven) or contractRepository.username (gradle)

Username used to connect to the Pact Broker

* pactbroker.auth.password (plugin prop)

* stubrunner.properties.pactbroker.auth.password (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_PASSWORD (env prop)

The password passed to contractsRepositoryPassword (maven) or contractRepository.password (gradle)

Password used to connect to the Pact Broker

* pactbroker.provider-name-with-group-id (plugin prop)

* stubrunner.properties.pactbroker.provider-name-with-group-id (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PROVIDER_NAME_WITH_GROUP_ID (env prop)

false

When true, the provider name will be a combination of groupId:artifactId. If false, just artifactId is used


\ No newline at end of file diff --git a/multi/multi_contract-dsl.html b/multi/multi_contract-dsl.html index 9be47ca5d6..314644b595 100644 --- a/multi/multi_contract-dsl.html +++ b/multi/multi_contract-dsl.html @@ -572,7 +572,27 @@ need to use patterns and not exact values both for your test and your server sid } }

You can also provide only one side of the communication with a regular expression. If you do so, then the contract engine automatically provides the generated string that matches -the provided regular expression. The following code shows an example:

In the preceding example, the opposite side of the communication has the respective data +the provided regular expression. The following code shows an example:

org.springframework.cloud.contract.spec.Contract.make {
+    request {
+        method 'PUT'
+        url value(consumer(regex('/foo/[0-9]{5}')))
+        body([
+                requestElement: $(consumer(regex('[0-9]{5}')))
+        ])
+        headers {
+            header('header', $(consumer(regex('application\\/vnd\\.fraud\\.v1\\+json;.*'))))
+        }
+    }
+    response {
+        status OK()
+        body([
+                responseElement: $(producer(regex('[0-9]{7}')))
+        ])
+        headers {
+            contentType("application/vnd.fraud.v1+json")
+        }
+    }
+}

In the preceding example, the opposite side of the communication has the respective data generated for request and response.

Spring Cloud Contract comes with a series of predefined regular expressions that you can use in your contracts, as shown in the following example:

protected static final Pattern TRUE_OR_FALSE = Pattern.compile(/(true|false)/)
 protected static final Pattern ALPHA_NUMERIC = Pattern.compile('[a-zA-Z0-9]+')
@@ -673,7 +693,100 @@ Pattern nonEmpty() {
 
 Pattern nonBlank() {
 	return NON_BLANK
-}

In your contract, you can use it as shown in the following example:

8.5.3 Passing Optional Parameters

[Important]Important

This section is valid only for Groovy DSL. Check out the +}

In your contract, you can use it as shown in the following example:

Contract dslWithOptionalsInString = Contract.make {
+    priority 1
+    request {
+        method POST()
+        url '/users/password'
+        headers {
+            contentType(applicationJson())
+        }
+        body(
+                email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
+                callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
+        )
+    }
+    response {
+        status 404
+        headers {
+            contentType(applicationJson())
+        }
+        body(
+                code: value(consumer("123123"), producer(optional("123123"))),
+                message: "User not found by email = [${value(producer(regex(email())), consumer('not.existing@user.com'))}]"
+        )
+    }
+}

To make matters even simpler you can use a set of predefined objects that will automatically assume that you want a regular expression to be passed. +All of those methods start with any prefix:

T anyAlphaUnicode()
+
+T anyAlphaNumeric()
+
+T anyNumber()
+
+T anyInteger()
+
+T anyPositiveInt()
+
+T anyDouble()
+
+T anyHex()
+
+T aBoolean()
+
+T anyIpAddress()
+
+T anyHostname()
+
+T anyEmail()
+
+T anyUrl()
+
+T anyHttpsUrl()
+
+T anyUuid()
+
+T anyDate()
+
+T anyDateTime()
+
+T anyTime()
+
+T anyIso8601WithOffset()
+
+T anyNonBlankString()
+
+T anyNonEmptyString()
+
+T anyOf(String... values)

and this is an example of how you can reference those methods:

Contract contractDsl = Contract.make {
+	label 'trigger_event'
+	input {
+		triggeredBy('toString()')
+	}
+	outputMessage {
+		sentTo 'topic.rateablequote'
+		body([
+				alpha: $(anyAlphaUnicode()),
+				number: $(anyNumber()),
+				anInteger: $(anyInteger()),
+				positiveInt: $(anyPositiveInt()),
+				aDouble: $(anyDouble()),
+				aBoolean: $(aBoolean()),
+				ip: $(anyIpAddress()),
+				hostname: $(anyHostname()),
+				email: $(anyEmail()),
+				url: $(anyUrl()),
+				httpsUrl: $(anyHttpsUrl()),
+				uuid: $(anyUuid()),
+				date: $(anyDate()),
+				dateTime: $(anyDateTime()),
+				time: $(anyTime()),
+				iso8601WithOffset: $(anyIso8601WithOffset()),
+				nonBlankString: $(anyNonBlankString()),
+				nonEmptyString: $(anyNonEmptyString()),
+				anyOf: $(anyOf('foo', 'bar'))
+		])
+	}
+}

8.5.3 Passing Optional Parameters

[Important]Important

This section is valid only for Groovy DSL. Check out the Section 8.5.7, “Dynamic Properties in the Matchers Sections” section for YAML examples of a similar feature.

It is possible to provide optional parameters in your contract. However, you can provide optional parameters only for the following:

  • STUB side of the Request
  • TEST side of the Response

The following example shows how to provide optional parameters:

org.springframework.cloud.contract.spec.Contract.make {
 	priority 1
diff --git a/single/spring-cloud-contract.html b/single/spring-cloud-contract.html
index ff575a8c39..0876d3c602 100644
--- a/single/spring-cloud-contract.html
+++ b/single/spring-cloud-contract.html
@@ -4021,7 +4021,27 @@ need to use patterns and not exact values both for your test and your server sid
 	}
 }

You can also provide only one side of the communication with a regular expression. If you do so, then the contract engine automatically provides the generated string that matches -the provided regular expression. The following code shows an example:

In the preceding example, the opposite side of the communication has the respective data +the provided regular expression. The following code shows an example:

org.springframework.cloud.contract.spec.Contract.make {
+    request {
+        method 'PUT'
+        url value(consumer(regex('/foo/[0-9]{5}')))
+        body([
+                requestElement: $(consumer(regex('[0-9]{5}')))
+        ])
+        headers {
+            header('header', $(consumer(regex('application\\/vnd\\.fraud\\.v1\\+json;.*'))))
+        }
+    }
+    response {
+        status OK()
+        body([
+                responseElement: $(producer(regex('[0-9]{7}')))
+        ])
+        headers {
+            contentType("application/vnd.fraud.v1+json")
+        }
+    }
+}

In the preceding example, the opposite side of the communication has the respective data generated for request and response.

Spring Cloud Contract comes with a series of predefined regular expressions that you can use in your contracts, as shown in the following example:

protected static final Pattern TRUE_OR_FALSE = Pattern.compile(/(true|false)/)
 protected static final Pattern ALPHA_NUMERIC = Pattern.compile('[a-zA-Z0-9]+')
@@ -4122,7 +4142,100 @@ Pattern nonEmpty() {
 
 Pattern nonBlank() {
 	return NON_BLANK
-}

In your contract, you can use it as shown in the following example:

8.5.3 Passing Optional Parameters

@@ -158,7 +158,7 @@ under the License. diff --git a/spring-cloud-contract.xml b/spring-cloud-contract.xml index 9501dff0dd..fea0499d03 100644 --- a/spring-cloud-contract.xml +++ b/spring-cloud-contract.xml @@ -4,7 +4,7 @@ Spring Cloud Contract -2018-12-03 +2018-11-21 @@ -6782,7 +6782,27 @@ need to use patterns and not exact values both for your test and your server sid You can also provide only one side of the communication with a regular expression. If you do so, then the contract engine automatically provides the generated string that matches the provided regular expression. The following code shows an example: - +org.springframework.cloud.contract.spec.Contract.make { + request { + method 'PUT' + url value(consumer(regex('/foo/[0-9]{5}'))) + body([ + requestElement: $(consumer(regex('[0-9]{5}'))) + ]) + headers { + header('header', $(consumer(regex('application\\/vnd\\.fraud\\.v1\\+json;.*')))) + } + } + response { + status OK() + body([ + responseElement: $(producer(regex('[0-9]{7}'))) + ]) + headers { + contentType("application/vnd.fraud.v1+json") + } + } +} In the preceding example, the opposite side of the communication has the respective data generated for request and response. Spring Cloud Contract comes with a series of predefined regular expressions that you can @@ -6888,7 +6908,104 @@ Pattern nonBlank() { return NON_BLANK } In your contract, you can use it as shown in the following example: - +Contract dslWithOptionalsInString = Contract.make { + priority 1 + request { + method POST() + url '/users/password' + headers { + contentType(applicationJson()) + } + body( + email: $(consumer(optional(regex(email()))), producer('abc@abc.com')), + callback_url: $(consumer(regex(hostname())), producer('http://partners.com')) + ) + } + response { + status 404 + headers { + contentType(applicationJson()) + } + body( + code: value(consumer("123123"), producer(optional("123123"))), + message: "User not found by email = [${value(producer(regex(email())), consumer('not.existing@user.com'))}]" + ) + } +} +To make matters even simpler you can use a set of predefined objects that will automatically assume that you want a regular expression to be passed. +All of those methods start with any prefix: +T anyAlphaUnicode() + +T anyAlphaNumeric() + +T anyNumber() + +T anyInteger() + +T anyPositiveInt() + +T anyDouble() + +T anyHex() + +T aBoolean() + +T anyIpAddress() + +T anyHostname() + +T anyEmail() + +T anyUrl() + +T anyHttpsUrl() + +T anyUuid() + +T anyDate() + +T anyDateTime() + +T anyTime() + +T anyIso8601WithOffset() + +T anyNonBlankString() + +T anyNonEmptyString() + +T anyOf(String... values) +and this is an example of how you can reference those methods: +Contract contractDsl = Contract.make { + label 'trigger_event' + input { + triggeredBy('toString()') + } + outputMessage { + sentTo 'topic.rateablequote' + body([ + alpha: $(anyAlphaUnicode()), + number: $(anyNumber()), + anInteger: $(anyInteger()), + positiveInt: $(anyPositiveInt()), + aDouble: $(anyDouble()), + aBoolean: $(aBoolean()), + ip: $(anyIpAddress()), + hostname: $(anyHostname()), + email: $(anyEmail()), + url: $(anyUrl()), + httpsUrl: $(anyHttpsUrl()), + uuid: $(anyUuid()), + date: $(anyDate()), + dateTime: $(anyDateTime()), + time: $(anyTime()), + iso8601WithOffset: $(anyIso8601WithOffset()), + nonBlankString: $(anyNonBlankString()), + nonEmptyString: $(anyNonEmptyString()), + anyOf: $(anyOf('foo', 'bar')) + ]) + } +}
Passing Optional Parameters
[Important]Important

This section is valid only for Groovy DSL. Check out the +}

In your contract, you can use it as shown in the following example:

Contract dslWithOptionalsInString = Contract.make {
+    priority 1
+    request {
+        method POST()
+        url '/users/password'
+        headers {
+            contentType(applicationJson())
+        }
+        body(
+                email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
+                callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
+        )
+    }
+    response {
+        status 404
+        headers {
+            contentType(applicationJson())
+        }
+        body(
+                code: value(consumer("123123"), producer(optional("123123"))),
+                message: "User not found by email = [${value(producer(regex(email())), consumer('not.existing@user.com'))}]"
+        )
+    }
+}

To make matters even simpler you can use a set of predefined objects that will automatically assume that you want a regular expression to be passed. +All of those methods start with any prefix:

T anyAlphaUnicode()
+
+T anyAlphaNumeric()
+
+T anyNumber()
+
+T anyInteger()
+
+T anyPositiveInt()
+
+T anyDouble()
+
+T anyHex()
+
+T aBoolean()
+
+T anyIpAddress()
+
+T anyHostname()
+
+T anyEmail()
+
+T anyUrl()
+
+T anyHttpsUrl()
+
+T anyUuid()
+
+T anyDate()
+
+T anyDateTime()
+
+T anyTime()
+
+T anyIso8601WithOffset()
+
+T anyNonBlankString()
+
+T anyNonEmptyString()
+
+T anyOf(String... values)

and this is an example of how you can reference those methods:

Contract contractDsl = Contract.make {
+	label 'trigger_event'
+	input {
+		triggeredBy('toString()')
+	}
+	outputMessage {
+		sentTo 'topic.rateablequote'
+		body([
+				alpha: $(anyAlphaUnicode()),
+				number: $(anyNumber()),
+				anInteger: $(anyInteger()),
+				positiveInt: $(anyPositiveInt()),
+				aDouble: $(anyDouble()),
+				aBoolean: $(aBoolean()),
+				ip: $(anyIpAddress()),
+				hostname: $(anyHostname()),
+				email: $(anyEmail()),
+				url: $(anyUrl()),
+				httpsUrl: $(anyHttpsUrl()),
+				uuid: $(anyUuid()),
+				date: $(anyDate()),
+				dateTime: $(anyDateTime()),
+				time: $(anyTime()),
+				iso8601WithOffset: $(anyIso8601WithOffset()),
+				nonBlankString: $(anyNonBlankString()),
+				nonEmptyString: $(anyNonEmptyString()),
+				anyOf: $(anyOf('foo', 'bar'))
+		])
+	}
+}

8.5.3 Passing Optional Parameters

[Important]Important

This section is valid only for Groovy DSL. Check out the Section 8.5.7, “Dynamic Properties in the Matchers Sections” section for YAML examples of a similar feature.

It is possible to provide optional parameters in your contract. However, you can provide optional parameters only for the following:

  • STUB side of the Request
  • TEST side of the Response

The following example shows how to provide optional parameters:

org.springframework.cloud.contract.spec.Contract.make {
 	priority 1
@@ -5957,13 +6070,13 @@ 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


10.7 Using the Pact Stub Downloader

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

* 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


10.7 Using the Pact Stub Downloader

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

* pactbroker.host (plugin prop)

* stubrunner.properties.pactbroker.host (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_HOST (env prop)

Host from URL passed to repositoryRoot

What is the URL of Pact Broker

* pactbroker.port (plugin prop)

* stubrunner.properties.pactbroker.port (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PORT (env prop)

Port from URL passed to repositoryRoot

What is the port of Pact Broker

* pactbroker.protocol (plugin prop)

* stubrunner.properties.pactbroker.protocol (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PROTOCOL (env prop)

Protocol from URL passed to repositoryRoot

What is the protocol of Pact Broker

* pactbroker.tags (plugin prop)

* stubrunner.properties.pactbroker.tags (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_TAGS (env prop)

Version of the stub, or latest if version is +

What tags should be used to fetch the stub

* pactbroker.auth.scheme (plugin prop)

* stubrunner.properties.pactbroker.auth.scheme (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_SCHEME (env prop)

Basic

What kind of authentication should be used to connect to the Pact Broker

* pactbroker.auth.username (plugin prop)

* stubrunner.properties.pactbroker.auth.username (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_USERNAME (env prop)

The username passed to contractsRepositoryUsername (maven) or contractRepository.username (gradle)

Username used to connect to the Pact Broker

* pactbroker.auth.password (plugin prop)

* stubrunner.properties.pactbroker.auth.password (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_PASSWORD (env prop)

The password passed to contractsRepositoryPassword (maven) or contractRepository.password (gradle)

Password used to connect to the Pact Broker

* pactbroker.provider-name-with-group-id (plugin prop)

* stubrunner.properties.pactbroker.provider-name-with-group-id (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PROVIDER_NAME_WITH_GROUP_ID (env prop)

false

When true, the provider name will be a combination of groupId:artifactId. If false, just artifactId is used


11. Spring Cloud Contract WireMock

The Spring Cloud Contract WireMock modules let you use WireMock in a +properties

Table 10.2. SCM Stub Downloader properties

Name of a property

Default

Description

* pactbroker.host (plugin prop)

* stubrunner.properties.pactbroker.host (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_HOST (env prop)

Host from URL passed to repositoryRoot

What is the URL of Pact Broker

* pactbroker.port (plugin prop)

* stubrunner.properties.pactbroker.port (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PORT (env prop)

Port from URL passed to repositoryRoot

What is the port of Pact Broker

* pactbroker.protocol (plugin prop)

* stubrunner.properties.pactbroker.protocol (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PROTOCOL (env prop)

Protocol from URL passed to repositoryRoot

What is the protocol of Pact Broker

* pactbroker.tags (plugin prop)

* stubrunner.properties.pactbroker.tags (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_TAGS (env prop)

Version of the stub, or latest if version is +

What tags should be used to fetch the stub

* pactbroker.auth.scheme (plugin prop)

* stubrunner.properties.pactbroker.auth.scheme (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_SCHEME (env prop)

Basic

What kind of authentication should be used to connect to the Pact Broker

* pactbroker.auth.username (plugin prop)

* stubrunner.properties.pactbroker.auth.username (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_USERNAME (env prop)

The username passed to contractsRepositoryUsername (maven) or contractRepository.username (gradle)

Username used to connect to the Pact Broker

* pactbroker.auth.password (plugin prop)

* stubrunner.properties.pactbroker.auth.password (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_PASSWORD (env prop)

The password passed to contractsRepositoryPassword (maven) or contractRepository.password (gradle)

Password used to connect to the Pact Broker

* pactbroker.provider-name-with-group-id (plugin prop)

* stubrunner.properties.pactbroker.provider-name-with-group-id (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PROVIDER_NAME_WITH_GROUP_ID (env prop)

false

When true, the provider name will be a combination of groupId:artifactId. If false, just artifactId is used


11. Spring Cloud Contract WireMock

The Spring Cloud Contract WireMock modules let you use WireMock in a Spring Boot application. Check out the samples for more details.

If you have a Spring Boot application that uses Tomcat as an embedded server (which is diff --git a/spring-cloud-contract-maven-plugin/checkstyle.rss b/spring-cloud-contract-maven-plugin/checkstyle.rss index e82c96df90..cefadd4428 100644 --- a/spring-cloud-contract-maven-plugin/checkstyle.rss +++ b/spring-cloud-contract-maven-plugin/checkstyle.rss @@ -130,7 +130,7 @@ under the License.

- org/springframework/cloud/contract/maven/verifier/RunMojo.java + org/springframework/cloud/contract/maven/verifier/stubrunner/RemoteStubRunner.java 0 @@ -139,7 +139,7 @@ under the License. 0 - 46 + 19
- org/springframework/cloud/contract/maven/verifier/stubrunner/RemoteStubRunner.java + org/springframework/cloud/contract/maven/verifier/RunMojo.java 0 @@ -167,7 +167,7 @@ under the License. 0 - 19 + 46