Skip to content

Commit

Permalink
feat: use pb relation in preference to beta relation when fetching pa…
Browse files Browse the repository at this point in the history
…cts for verification
  • Loading branch information
bethesque committed Sep 12, 2020
1 parent dd35366 commit 7563fcf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/pact/pact_broker/fetch_pact_uris_for_verification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class FetchPactURIsForVerification
include PactSelectionDescription
attr_reader :provider, :consumer_version_selectors, :provider_version_tags, :broker_base_url, :http_client_options, :http_client, :options

PACTS_FOR_VERIFICATION_RELATION = 'beta:provider-pacts-for-verification'.freeze
PACTS_FOR_VERIFICATION_RELATION = 'pb:provider-pacts-for-verification'.freeze
PACTS_FOR_VERIFICATION_RELATION_BETA = 'beta:provider-pacts-for-verification'.freeze
PACTS = 'pacts'.freeze
HREF = 'href'.freeze
LINKS = '_links'.freeze
Expand All @@ -34,7 +35,7 @@ def self.call(provider, consumer_version_selectors, provider_version_tags, broke
end

def call
if index.can?(PACTS_FOR_VERIFICATION_RELATION)
if index.can?(PACTS_FOR_VERIFICATION_RELATION) || index.can?(PACTS_FOR_VERIFICATION_RELATION_BETA)
log_message
pacts_for_verification
else
Expand Down Expand Up @@ -63,7 +64,7 @@ def pacts_for_verification

def pacts_for_verification_entity
index
._link(PACTS_FOR_VERIFICATION_RELATION)
._link(PACTS_FOR_VERIFICATION_RELATION, PACTS_FOR_VERIFICATION_RELATION_BETA)
.expand(provider: provider)
.post!(query)
end
Expand Down

0 comments on commit 7563fcf

Please sign in to comment.