Skip to content

Commit

Permalink
feat: Update JUnit 5 readme with Consumer Version Selectors DSL
Browse files Browse the repository at this point in the history
  • Loading branch information
uglyog committed Jul 5, 2022
1 parent 79b0038 commit 0ccc32d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions provider/junit5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,19 @@ For example:
// Select Pacts for consumers deployed to production with branch 'FEAT-123'
return new SelectorBuilder()
.environment('production')
.branch('FEAT-123')
.branch('FEAT-123');
}
```

or where the branch is set as an environment variable:
Or for example where the branch is set with the `BRANCH_NAME` environment variable:

```java
@au.com.dius.pact.provider.junitsupport.loader.ConsumerVersionSelectors
static SelectorBuilder consumerVersionSelectors() {
// Select Pacts for consumers deployed to production with branch from CI build
return new SelectorBuilder()
.environment('production')
.branch(System.getenv('BRANCH_NAME'))
.branch(System.getenv('BRANCH_NAME'));
}
```

Expand All @@ -166,6 +166,9 @@ Used for coordinated development between consumer and provider teams using match
- `tag(name: String)` - [DEPRECATED] All versions with the specified tag. Tags are deprecated in favor of branches.
- `latestTag(name: String)` - [DEPRECATED] The latest version for each consumer with the specified tag. Tags are deprecated in favor of branches.

If you require more control, your selector method can also return a list of `au.com.dius.pact.core.pactbroker.ConsumerVersionSelectors`
instead of the builder class.

### Providing the raw Consumer Version Selectors JSON

You can also set the consumer versions selectors as raw JSON with the `pactbroker.consumerversionselectors.rawjson` JVM
Expand Down

0 comments on commit 0ccc32d

Please sign in to comment.