diff --git a/types/consumer_version_selector.go b/types/consumer_version_selector.go index 2ecbeccc3..eb8b4354e 100644 --- a/types/consumer_version_selector.go +++ b/types/consumer_version_selector.go @@ -6,11 +6,16 @@ import "fmt" // versions we want to use when configuring verifications // See https://docs.pact.io/selectors for more type ConsumerVersionSelector struct { - Pacticipant string `json:"pacticipant"` - Tag string `json:"tag"` - Version string `json:"version"` - Latest bool `json:"latest"` - All bool `json:"all"` + Pacticipant string `json:"pacticipant"` + Tag string `json:"tag"` + Version string `json:"version"` + Latest bool `json:"latest"` + All bool `json:"all"` + Consumer string `json:"consumer"` + DeployedOrReleased bool `json:"deployedOrReleased"` + Deployed bool `json:"deployed"` + Released bool `json:"released"` + Environment string `json:"environment"` } // Validate the selector configuration diff --git a/types/consumer_version_selector_test.go b/types/consumer_version_selector_test.go index e29a3e1c4..af2ad6822 100644 --- a/types/consumer_version_selector_test.go +++ b/types/consumer_version_selector_test.go @@ -18,6 +18,11 @@ func TestConsumerVersionSelectorValidate(t *testing.T) { {name: "pacticipant only", selector: ConsumerVersionSelector{Pacticipant: "foo"}, err: true}, {name: "pacticipant and tag", selector: ConsumerVersionSelector{Pacticipant: "foo", Tag: "foo"}, err: false}, {name: "pacticipant, tag and all set", selector: ConsumerVersionSelector{Pacticipant: "foo", Tag: "foo", All: true}, err: false}, + {name: "pacticipant, tag, consumer", selector: ConsumerVersionSelector{Pacticipant: "foo", Tag: "foo", Consumer: "bar"}, err: false}, + {name: "pacticipant, tag, deployedOrReleased", selector: ConsumerVersionSelector{Pacticipant: "foo", Tag: "foo", DeployedOrReleased: true}, err: false}, + {name: "pacticipant, tag, deployed", selector: ConsumerVersionSelector{Pacticipant: "foo", Tag: "foo", Deployed: true}, err: false}, + {name: "pacticipant, tag, released", selector: ConsumerVersionSelector{Pacticipant: "foo", Tag: "foo", Released: true}, err: false}, + {name: "pacticipant, tag, environment", selector: ConsumerVersionSelector{Pacticipant: "foo", Tag: "foo", Environment: "dev"}, err: false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {