From b3fd3cfa752374a3d776c0b1cbb239463458d5a6 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Mon, 4 Sep 2023 11:28:43 +1000 Subject: [PATCH] chore: update url expectation for pf:ui when publishing provider contracts the old way Do not expect any particular format for the url - that is the provider's business, not the consumer's --- doc/pacts/markdown/Pact Broker Client - Pactflow.md | 2 +- spec/pacts/pact_broker_client-pactflow.json | 7 ++++++- .../pactflow_publish_provider_contract_spec.rb | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/pacts/markdown/Pact Broker Client - Pactflow.md b/doc/pacts/markdown/Pact Broker Client - Pactflow.md index 7133e5e..491a95e 100644 --- a/doc/pacts/markdown/Pact Broker Client - Pactflow.md +++ b/doc/pacts/markdown/Pact Broker Client - Pactflow.md @@ -114,7 +114,7 @@ PactFlow will respond with: "body": { "_links": { "pf:ui": { - "href": "http://localhost:1235/contracts/bi-directional/provider/Bar/version/1/provider-contract" + "href": "some-url" } } } diff --git a/spec/pacts/pact_broker_client-pactflow.json b/spec/pacts/pact_broker_client-pactflow.json index 78a694b..bffebb2 100644 --- a/spec/pacts/pact_broker_client-pactflow.json +++ b/spec/pacts/pact_broker_client-pactflow.json @@ -68,9 +68,14 @@ "body": { "_links": { "pf:ui": { - "href": "http://localhost:1235/contracts/bi-directional/provider/Bar/version/1/provider-contract" + "href": "some-url" } } + }, + "matchingRules": { + "$.body._links.pf:ui.href": { + "match": "type" + } } } }, diff --git a/spec/service_providers/pactflow_publish_provider_contract_spec.rb b/spec/service_providers/pactflow_publish_provider_contract_spec.rb index 69add63..b15d875 100644 --- a/spec/service_providers/pactflow_publish_provider_contract_spec.rb +++ b/spec/service_providers/pactflow_publish_provider_contract_spec.rb @@ -98,7 +98,7 @@ headers: pact_broker_response_headers, body: { "_links": { "pf:ui": { - "href": "#{pactflow.mock_service_base_url}/contracts/bi-directional/provider/Bar/version/1/provider-contract" + "href": Pact.like("some-url") } } } } @@ -121,7 +121,7 @@ expect(subject.success).to be true expect(subject.message).to include "Successfully published provider contract for Bar version 1" expect(subject.message).to include "Next steps:" - expect(subject.message).to include success_response_with_pf_ui_url[:body][:_links][:'pf:ui'][:href] + expect(subject.message).to include "some-url" end end end \ No newline at end of file