-
-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: include the consumer name in the selectors sent to the broker #1193
- Loading branch information
Ronald Holshausen
committed
Oct 1, 2020
1 parent
8d40c92
commit 358a76d
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...roker/src/test/groovy/au/com/dius/pact/core/pactbroker/ConsumerVersionSelectorSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package au.com.dius.pact.core.pactbroker | ||
|
||
import spock.lang.Specification | ||
import spock.lang.Unroll | ||
|
||
class ConsumerVersionSelectorSpec extends Specification { | ||
|
||
@Unroll | ||
def 'convert to JSON'() { | ||
expect: | ||
new ConsumerVersionSelector(tag, latest, consumer).toJson().serialise() == json | ||
|
||
where: | ||
|
||
tag | latest | consumer | json | ||
'A' | true | null | '{"latest":true,"tag":"A"}' | ||
'A' | false | null | '{"latest":false,"tag":"A"}' | ||
'A' | false | 'Bob' | '{"consumer":"Bob","latest":false,"tag":"A"}' | ||
null | false | 'Bob' | '{"consumer":"Bob","latest":false}' | ||
} | ||
} |