Skip to content

Commit 3bee551

Browse files
stubrunner. -> spring.cloud.contract.stubrunner. property migration
Signed-off-by: Marcin Grzejszczak <[email protected]>
1 parent 3ea3d7a commit 3bee551

File tree

73 files changed

+262
-241
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+262
-241
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
IMPORTANT: The following properties can be passed as a system property (for example, `stubrunner.properties.git.branch`), as an environment variable (for example, `STUBRUNNER_PROPERTIES_GIT_BRANCH`), or as a property inside stub runner's annotation or a JUnit Rule (JUnit 4) or Extension (JUnit 5). In the latter case, you can pass the `git.branch` property instead of `stubrunner.properties.git.branch`.
1+
IMPORTANT: The following properties can be passed as a system property (for example, `spring.cloud.contract.stubrunner.properties.git.branch`), as an environment variable (for example, `SPRING_CLOUD_CONTRACT_STUBRUNNER_PROPERTIES_GIT_BRANCH`), or as a property inside stub runner's annotation or a JUnit Rule (JUnit 4) or Extension (JUnit 5). In the latter case, you can pass the `git.branch` property instead of `spring.cloud.contract.stubrunner.properties.git.branch`.
22

33
.Stubrunner Properties Options
44
|===
55
|Name | Default | Description
66

7-
|`stubrunner.properties.git.branch` | | When using the SCM-based approach, you can customize the branch name to check out.
8-
|`stubrunner.properties.git.commit-message` | Updating project [$project] with stubs | When using the SCM based approach, you can customize the commit message for created stubs. The `$project` text is replaced with the project name.
9-
|`stubrunner.properties.git.no-of-attempts` | `10` | When using the-SCM based approach, you can customize the number of retries to push the stubs to Git.
10-
|`stubrunner.properties.git.username` | | When using the SCM-based approach, you can pass the username to connect to the git repository.
11-
|`stubrunner.properties.git.password` | | When using the SCM-based approach, you can pass the password to connect to the git repository.
12-
|`stubrunner.properties.git.wait-between-attempts` | `1000` | When using the SCM-based approach, you can customize waiting time in ms between attempts to push the stubs to git.
13-
|`stubrunner.properties.git.ensure-git-suffix` | `true` | When using the SCM based approach, you can prevent stubrunner from adding `.git` to the repository URL by setting this property to `false`. This adds compatibility with git repositories which do not support such URLs, for example Azure DevOps.
7+
|`spring.cloud.contract.stubrunner.properties.git.branch` | | When using the SCM-based approach, you can customize the branch name to check out.
8+
|`spring.cloud.contract.stubrunner.properties.git.commit-message` | Updating project [$project] with stubs | When using the SCM based approach, you can customize the commit message for created stubs. The `$project` text is replaced with the project name.
9+
|`spring.cloud.contract.stubrunner.properties.git.no-of-attempts` | `10` | When using the-SCM based approach, you can customize the number of retries to push the stubs to Git.
10+
|`spring.cloud.contract.stubrunner.properties.git.username` | | When using the SCM-based approach, you can pass the username to connect to the git repository.
11+
|`spring.cloud.contract.stubrunner.properties.git.password` | | When using the SCM-based approach, you can pass the password to connect to the git repository.
12+
|`spring.cloud.contract.stubrunner.properties.git.wait-between-attempts` | `1000` | When using the SCM-based approach, you can customize waiting time in ms between attempts to push the stubs to git.
13+
|`spring.cloud.contract.stubrunner.properties.git.ensure-git-suffix` | `true` | When using the SCM based approach, you can prevent stubrunner from adding `.git` to the repository URL by setting this property to `false`. This adds compatibility with git repositories which do not support such URLs, for example Azure DevOps.
1414

15-
|`stubrunner.properties.stubs.find-producer` | `false` | When using the `stubs` protocol, you can toggle this flag to search for contracts in the `group id / artifact id` instead of taking the stubs directly from the provided folder.
15+
|`spring.cloud.contract.stubrunner.properties.stubs.find-producer` | `false` | When using the `stubs` protocol, you can toggle this flag to search for contracts in the `group id / artifact id` instead of taking the stubs directly from the provided folder.
1616

1717
|===

docs/modules/ROOT/pages/customization/pluggable-architecture.adoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,45 +183,45 @@ properties:
183183
|
184184
* `git.branch` (plugin prop)
185185

186-
* `stubrunner.properties.git.branch` (system prop)
186+
* `spring.cloud.contract.stubrunner.properties.git.branch` (system prop)
187187

188-
* `STUBRUNNER_PROPERTIES_GIT_BRANCH` (env prop)
188+
* `SPRING_CLOUD_CONTRACT_STUBRUNNER_PROPERTIES_GIT_BRANCH` (env prop)
189189
|master
190190
|Which branch to checkout
191191

192192
|
193193
* `git.username` (plugin prop)
194194

195-
* `stubrunner.properties.git.username` (system prop)
195+
* `spring.cloud.contract.stubrunner.properties.git.username` (system prop)
196196

197-
* `STUBRUNNER_PROPERTIES_GIT_USERNAME` (env prop)
197+
* `SPRING_CLOUD_CONTRACT_STUBRUNNER_PROPERTIES_GIT_USERNAME` (env prop)
198198
|
199199
|Git clone username
200200

201201
|
202202
* `git.password` (plugin prop)
203203

204-
* `stubrunner.properties.git.password` (system prop)
204+
* `spring.cloud.contract.stubrunner.properties.git.password` (system prop)
205205

206-
* `STUBRUNNER_PROPERTIES_GIT_PASSWORD` (env prop)
206+
* `SPRING_CLOUD_CONTRACT_STUBRUNNER_PROPERTIES_GIT_PASSWORD` (env prop)
207207
|
208208
|Git clone password
209209

210210
|
211211
* `git.no-of-attempts` (plugin prop)
212212

213-
* `stubrunner.properties.git.no-of-attempts` (system prop)
213+
* `spring.cloud.contract.stubrunner.properties.git.no-of-attempts` (system prop)
214214

215-
* `STUBRUNNER_PROPERTIES_GIT_NO_OF_ATTEMPTS` (env prop)
215+
* `SPRING_CLOUD_CONTRACT_STUBRUNNER_PROPERTIES_GIT_NO_OF_ATTEMPTS` (env prop)
216216
|10
217217
|Number of attempts to push the commits to `origin`
218218

219219
|
220220
* `git.wait-between-attempts` (Plugin prop)
221221

222-
* `stubrunner.properties.git.wait-between-attempts` (system prop)
222+
* `spring.cloud.contract.stubrunner.properties.git.wait-between-attempts` (system prop)
223223

224-
* `STUBRUNNER_PROPERTIES_GIT_WAIT_BETWEEN_ATTEMPTS` (env prop)
224+
* `SPRING_CLOUD_CONTRACT_STUBRUNNER_PROPERTIES_GIT_WAIT_BETWEEN_ATTEMPTS` (env prop)
225225
|1000
226226
|Number of milliseconds to wait between attempts to push the commits to `origin`
227227
|===

docs/modules/ROOT/pages/docker-project.adoc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ You can run the docker image and pass any of the xref:project-features-stubrunne
391391
as environment variables. The convention is that all the
392392
letters should be upper case.
393393
The dot (`.`) should be replaced with underscore (`_`) characters. For example,
394-
the `stubrunner.repositoryRoot` property should be represented
395-
as a `STUBRUNNER_REPOSITORY_ROOT` environment variable.
394+
the `spring.cloud.contract.stubrunner.repositoryRoot` property should be represented
395+
as a `SPRING_COUD_CONTRACT_STUBRUNNER_REPOSITORY_ROOT` environment variable.
396396

397397
In addition to those variables you can set the following ones:
398398

@@ -422,15 +422,15 @@ $ SC_CONTRACT_DOCKER_VERSION="..."
422422
# The IP at which the app is running and Docker container can reach it
423423
$ APP_IP="192.168.0.100"
424424
# Spring Cloud Contract Stub Runner properties
425-
$ STUBRUNNER_PORT="8083"
425+
$ SPRING_CLOUD_CONTRACT_STUBRUNNER_PORT="8083"
426426
# Stub coordinates 'groupId:artifactId:version:classifier:port'
427-
$ STUBRUNNER_IDS="com.example:bookstore:0.0.1.RELEASE:stubs:9876"
428-
$ STUBRUNNER_REPOSITORY_ROOT="http://${APP_IP}:8081/artifactory/libs-release-local"
427+
$ SPRING_CLOUD_CONTRACT_STUBRUNNER_IDS="com.example:bookstore:0.0.1.RELEASE:stubs:9876"
428+
$ SPRING_CLOUD_CONTRACT_STUBRUNNER_REPOSITORY_ROOT="http://${APP_IP}:8081/artifactory/libs-release-local"
429429
# Run the docker with Stub Runner Boot
430430
$ docker run --rm \
431-
-e "STUBRUNNER_IDS=${STUBRUNNER_IDS}" \
432-
-e "STUBRUNNER_REPOSITORY_ROOT=${STUBRUNNER_REPOSITORY_ROOT}" \
433-
-e "STUBRUNNER_STUBS_MODE=REMOTE" \
431+
-e "SPRING_CLOUD_CONTRACT_STUBRUNNER_IDS=${STUBRUNNER_IDS}" \
432+
-e "SPRING_CLOUD_CONTRACT_STUBRUNNER_REPOSITORY_ROOT=${STUBRUNNER_REPOSITORY_ROOT}" \
433+
-e "SPRING_CLOUD_CONTRACT_STUBRUNNER_STUBS_MODE=REMOTE" \
434434
-p "${STUBRUNNER_PORT}:${STUBRUNNER_PORT}" \
435435
-p "9876:9876" \
436436
springcloud/spring-cloud-contract-stub-runner:"${SC_CONTRACT_DOCKER_VERSION}"
@@ -572,10 +572,10 @@ Example of usage
572572
```bash
573573
$ docker run \
574574
-e "CAMEL_COMPONENT_RABBITMQ_ADDRESSES=172.18.0.1:5672" \ <1>
575-
-e "STUBRUNNER_IDS=group:application:0.0.1-SNAPSHOT" \ <2>
576-
-e "STUBRUNNER_REPOSITORY_ROOT=git://https://github.com/marcingrzejszczak/cdct_python_contracts.git" \ <3>
575+
-e "SPRING_CLOUD_CONTRACT_STUBRUNNER_IDS=group:application:0.0.1-SNAPSHOT" \ <2>
576+
-e "SPRING_CLOUD_CONTRACT_STUBRUNNER_REPOSITORY_ROOT=git://https://github.com/marcingrzejszczak/cdct_python_contracts.git" \ <3>
577577
-e ADDITIONAL_OPTS="--thin.properties.dependencies.rabbitmq=org.apache.camel.springboot:camel-rabbitmq-starter:3.4.0" \ <4>
578-
-e "STUBRUNNER_STUBS_MODE=REMOTE" \ <5>
578+
-e "SPRING_CLOUD_CONTRACT_STUBRUNNER_STUBS_MODE=REMOTE" \ <5>
579579
-v "${HOME}/.m2/:/home/scc/.m2:rw" \ <6>
580580
-p 8750:8750 \ <7>
581581
springcloud/spring-cloud-contract-stub-runner:3.0.4-SNAPSHOT <8>

docs/modules/ROOT/pages/project-features-messaging.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ a stub. Then it is parsed on the consumer side, and proper stubbed routes are cr
189189
IMPORTANT: If you have multiple frameworks on the classpath, Stub Runner needs to
190190
define which one should be used. Assume that you have AMQP, Spring Cloud Stream, and Spring Integration
191191
on the classpath and that you want to use Spring AMQP. Then you need to set
192-
`stubrunner.stream.enabled=false` and `stubrunner.integration.enabled=false`.
192+
`spring.cloud.contract.stubrunner.stream.enabled=false` and `spring.cloud.contract.stubrunner.integration.enabled=false`.
193193
That way, the only remaining framework is Spring AMQP.
194194

195195
[[features-messaging-stub-triggering]]
@@ -277,7 +277,7 @@ Remember to annotate your test class with `@AutoConfigureStubRunner`.
277277
[[features-messaging-stub-runner-camel-disabling]]
278278
=== Disabling the Functionality
279279

280-
If you need to disable this functionality, set the `stubrunner.camel.enabled=false` property.
280+
If you need to disable this functionality, set the `spring.cloud.contract.stubrunner.camel.enabled=false` property.
281281

282282
[[features-messaging-stub-runner-camel-example]]
283283
=== Examples
@@ -357,7 +357,7 @@ classpath. Remember to annotate your test class with `@AutoConfigureStubRunner`.
357357
=== Disabling the Functionality
358358

359359
If you need to disable this functionality, set the
360-
`stubrunner.integration.enabled=false` property.
360+
`spring.cloud.contract.stubrunner.integration.enabled=false` property.
361361

362362
[[features-messaging-stub-runner-integration-example]]
363363
=== Examples
@@ -471,7 +471,7 @@ classpath. Remember to annotate your test class with `@AutoConfigureStubRunner`.
471471
[[features-messaging-stub-runner-stream-disabling]]
472472
=== Disabling the Functionality
473473

474-
If you need to disable this functionality, set the `stubrunner.stream.enabled=false`
474+
If you need to disable this functionality, set the `spring.cloud.contract.stubrunner.stream.enabled=false`
475475
property.
476476

477477
[[features-messaging-stub-runner-stream-example]]
@@ -588,7 +588,7 @@ Further assume the following test configuration:
588588
====
589589
[source,yml,indent=0]
590590
----
591-
stubrunner:
591+
spring.cloud.contract.stubrunner:
592592
repository-root: stubs:classpath:/stubs/
593593
ids: my:stubs
594594
stubs-mode: remote

docs/modules/ROOT/pages/project-features-stubrunner/stub-runner-boot.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ by running the following commands:
4444
[source,bash,indent=0]
4545
----
4646
$ wget -O stub-runner.jar 'https://search.maven.org/remotecontent?filepath=org/springframework/cloud/spring-cloud-contract-stub-runner-boot/2.0.1.RELEASE/spring-cloud-contract-stub-runner-boot-2.0.1.RELEASE.jar'
47-
$ java -jar stub-runner.jar --stubrunner.ids=... --stubrunner.repositoryRoot=...
47+
$ java -jar stub-runner.jar --spring.cloud.contract.stubrunner.ids=... --spring.cloud.contract.stubrunner.repositoryRoot=...
4848
----
4949
====
5050

@@ -54,7 +54,7 @@ $ java -jar stub-runner.jar --stubrunner.ids=... --stubrunner.repositoryRoot=...
5454
Starting from the `1.4.0.RELEASE` version of the https://cloud.spring.io/spring-cloud-cli[Spring Cloud CLI]
5555
project, you can start Stub Runner Boot by running `spring cloud stubrunner`.
5656

57-
To pass the configuration, you can create a `stubrunner.yml` file in the current working directory,
57+
To pass the configuration, you can create a `spring.cloud.contract.stubrunner.yml` file in the current working directory,
5858
in a subdirectory called `config`, or in `~/.spring-cloud`. The file could resemble the following
5959
example for running stubs installed locally:
6060

@@ -63,7 +63,7 @@ example for running stubs installed locally:
6363
====
6464
[source,yml,indent=0]
6565
----
66-
stubrunner:
66+
spring.cloud.contract.stubrunner:
6767
stubsMode: LOCAL
6868
ids:
6969
- com.example:beer-api-producer:+:9876

docs/modules/ROOT/pages/project-features-stubrunner/stub-runner-cloud.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ in a static block such as the following example (for Eureka):
4949
[[features-stub-runner-additional-config]]
5050
== Additional Configuration
5151

52-
You can match the `artifactId` of the stub with the name of your application by using the `stubrunner.idsToServiceIds:` map.
52+
You can match the `artifactId` of the stub with the name of your application by using the `spring.cloud.contract.stubrunner.idsToServiceIds:` map.
5353

5454
TIP: By default, all service discovery is stubbed. This means that, regardless of whether you have
5555
an existing `DiscoveryClient`, its results are ignored. However, if you want to reuse it, you can set
56-
`stubrunner.cloud.delegate.enabled` to `true`, and then your existing `DiscoveryClient` results are
56+
`spring.cloud.contract.stubrunner.cloud.delegate.enabled` to `true`, and then your existing `DiscoveryClient` results are
5757
merged with the stubbed ones.
5858

5959
The default Maven configuration used by Stub Runner can be tweaked either

docs/modules/ROOT/pages/project-features-stubrunner/stub-runner-common.adoc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ properties. The following table shows their names with their default values:
1717
[frame="topbot",options="header"]
1818
|===============
1919
| Property name | Default value | Description
20-
|`stubrunner.minPort`|`10000`| Minimum value of a port for a started WireMock with stubs.
21-
|`stubrunner.maxPort`|`15000`| Maximum value of a port for a started WireMock with stubs.
22-
|`stubrunner.repositoryRoot`|| Maven repository URL. If blank, then call the local Maven repo.
23-
|`stubrunner.classifier`|`stubs`| Default classifier for the stub artifacts.
24-
|`stubrunner.stubsMode`|`CLASSPATH`| The way you want to fetch and register the stubs.
25-
|`stubrunner.ids`|| Array of Ivy notation stubs to download.
26-
|`stubrunner.username`|| Optional username to access the tool that stores the JARs with
20+
|`spring.cloud.contract.stubrunner.minPort`|`10000`| Minimum value of a port for a started WireMock with stubs.
21+
|`spring.cloud.contract.stubrunner.maxPort`|`15000`| Maximum value of a port for a started WireMock with stubs.
22+
|`spring.cloud.contract.stubrunner.repositoryRoot`|| Maven repository URL. If blank, then call the local Maven repo.
23+
|`spring.cloud.contract.stubrunner.classifier`|`stubs`| Default classifier for the stub artifacts.
24+
|`spring.cloud.contract.stubrunner.stubsMode`|`CLASSPATH`| The way you want to fetch and register the stubs.
25+
|`spring.cloud.contract.stubrunner.ids`|| Array of Ivy notation stubs to download.
26+
|`spring.cloud.contract.stubrunner.username`|| Optional username to access the tool that stores the JARs with
2727
stubs.
28-
|`stubrunner.password`|| Optional password to access the tool that stores the JARs with
28+
|`spring.cloud.contract.stubrunner.password`|| Optional password to access the tool that stores the JARs with
2929
stubs.
30-
|`stubrunner.stubsPerConsumer`|`false`| Set to `true` if you want to use different stubs for
30+
|`spring.cloud.contract.stubrunner.stubsPerConsumer`|`false`| Set to `true` if you want to use different stubs for
3131
each consumer instead of registering all stubs for every consumer.
32-
|`stubrunner.consumerName`|| If you want to use a stub for each consumer and want to
32+
|`spring.cloud.contract.stubrunner.consumerName`|| If you want to use a stub for each consumer and want to
3333
override the consumer name, change this value.
3434
|===============
3535

3636
[[features-stub-runner-stub-runner-stub-ids]]
3737
== Stub Runner Stubs IDs
3838

39-
You can set the stubs to download in the `stubrunner.ids` system property. They
39+
You can set the stubs to download in the `spring.cloud.contract.stubrunner.ids` system property. They
4040
use the following pattern:
4141

4242
====

docs/modules/ROOT/pages/project-features-stubrunner/stub-runner-generate-stubs-at-runtime.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ As a consumer, you might not want to wait for the producer to finish its impleme
77

88
As a producer, when a contract is defined, you are required to make the generated tests pass in order for the stubs to be published. There are cases where you would like to unblock the consumers so that they can fetch the stubs before your tests actually pass. In this case, you should set such contracts as in-progress. You can read more about this under the xref:project-features-contract/common-top-elements.adoc#contract-dsl-in-progress[Contracts in Progress] section. That way, your tests are not generated, but the stubs are generated.
99

10-
As a consumer, you can toggle a switch to generate stubs at runtime. Stub Runner ignores all the existing stub mappings and generates new ones for all the contract definitions. Another option is to pass the `stubrunner.generate-stubs` system property. The following example shows such a setup:
10+
As a consumer, you can toggle a switch to generate stubs at runtime. Stub Runner ignores all the existing stub mappings and generates new ones for all the contract definitions. Another option is to pass the `spring.cloud.contract.stubrunner.generate-stubs` system property. The following example shows such a setup:
1111

1212
====
1313
[source,java,indent=0,subs="verbatim",role="primary"]

docs/modules/ROOT/pages/project-features-stubrunner/stub-runner-junit.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ Stub Runner Spring registers environment variables in the following manner
145145
for every registered WireMock server. The following example shows Stub Runner IDs for
146146
`com.example:thing1` and `com.example:thing2`:
147147

148-
- `stubrunner.runningstubs.thing1.port`
149-
- `stubrunner.runningstubs.com.example.thing1.port`
150-
- `stubrunner.runningstubs.thing2.port`
151-
- `stubrunner.runningstubs.com.example.thing2.port`
148+
- `spring.cloud.contract.stubrunner.runningstubs.thing1.port`
149+
- `spring.cloud.contract.stubrunner.runningstubs.com.example.thing1.port`
150+
- `spring.cloud.contract.stubrunner.runningstubs.thing2.port`
151+
- `spring.cloud.contract.stubrunner.runningstubs.com.example.thing2.port`
152152

153153
You can reference these values in your code.
154154

docs/modules/ROOT/pages/project-features-stubrunner/stub-runner-stubs-per-consumer.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ You cannot produce two different responses for the same request. That is why you
4848
contracts and then profit from the `stubsPerConsumer` feature.
4949

5050
On the producer side, the consumers can have a folder that contains contracts related only to them.
51-
By setting the `stubrunner.stubs-per-consumer` flag to `true`, we no longer register all stubs but only those that
51+
By setting the `spring.cloud.contract.stubrunner.stubs-per-consumer` flag to `true`, we no longer register all stubs but only those that
5252
correspond to the consumer application's name. In other words, we scan the path of every stub and,
5353
if it contains a subfolder with name of the consumer in the path, only then is it registered.
5454

@@ -66,7 +66,7 @@ On the `foo` producer side the contracts would look like this
6666
└── shouldCallFoo.groovy
6767
----
6868

69-
The `bar-consumer` consumer can either set the `spring.application.name` or the `stubrunner.consumer-name` to `bar-consumer`
69+
The `bar-consumer` consumer can either set the `spring.application.name` or the `spring.cloud.contract.stubrunner.consumer-name` to `bar-consumer`
7070
Alternatively, you can set the test as follows:
7171

7272
====

0 commit comments

Comments
 (0)