Skip to content

Commit

Permalink
chore: update url expectation for pf:ui when publishing provider cont…
Browse files Browse the repository at this point in the history
…racts the old way

Do not expect any particular format for the url - that is the provider's business, not the consumer's
  • Loading branch information
bethesque committed Sep 4, 2023
1 parent 395aa9e commit b3fd3cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/pacts/markdown/Pact Broker Client - Pactflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion spec/pacts/pact_broker_client-pactflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
} }
}
Expand All @@ -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

2 comments on commit b3fd3cf

@bethesque
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc: @YOU54F this was failing on the provider side because the host didn't match. Have changed the expectation - there's no reason for the client to know the format of this URL (or generally speaking, of any URL unless the URL has to be manually constructed on the client side)

@YOU54F
Copy link
Member

@YOU54F YOU54F commented on b3fd3cf Sep 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😬 yeah that be a test code smell. Thanks for updating @bethesque

Please sign in to comment.