-
-
Notifications
You must be signed in to change notification settings - Fork 230
Correctly map the Pact Interaction Description property #1331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures the Pact interaction description
field is always populated (falling back to title when explicit description is missing) and updates related tests and fixtures to use description
instead of providerState
.
- Update
PactMapper
to prefermapping.Description
and fall back tomapping.Title
- Modify JSON fixtures to replace
providerState
withdescription
- Add VerifyXunit support and a new POST-description test
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
test/WireMock.Net.Tests/Pact/files/pact-post.json | New fixture for POST interaction using description |
test/WireMock.Net.Tests/Pact/files/pact-multiple.json | Replaced providerState with description in multiple interactions |
test/WireMock.Net.Tests/Pact/files/pact-get.json | Replaced providerState with description in GET interaction |
test/WireMock.Net.Tests/Pact/PactTests.cs | Added VerifyXunit, made tests async, and added POST-description test |
test/WireMock.Net.Tests/Pact/PactTests.SavePact_Get_Request_WithDescription.verified.json | New snapshot for the description test |
test/WireMock.Net.Tests/Pact/PactTests.SavePact_Get_Request_And_Response_WithBodyAsJson.verified.json | Updated snapshot for GET response test |
test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.cs | Removed unused WireMock.Models import |
src/WireMock.Net.Minimal/Serialization/PactMapper.cs | Consolidated description/title mapping into a single Description assignment |
Comments suppressed due to low confidence (1)
test/WireMock.Net.Tests/Pact/PactTests.cs:246
- This test still uses a generic length assertion; consider switching to
await Verifier.VerifyFile(path)
so the generated JSON (includingdescription
) is validated against a snapshot.
File.ReadAllBytes(Path.Combine(folder, file)).Length.Should().BeGreaterThan(1);
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1331 +/- ##
==========================================
- Coverage 37.17% 37.16% -0.01%
==========================================
Files 176 176
Lines 40858 40861 +3
==========================================
- Hits 15188 15187 -1
- Misses 25246 25250 +4
Partials 424 424 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <[email protected]>
@StefH yup, this is what I was looking for. I'd still have to test it properly when you have released this fix, but it looks good. I wanted to publish the pact that you generated, the Again, this looks good, I'm happy to test it with my own contract and code once you've released the update. |
I would think that the generated JSON file would be valid? Can you more details on why it fails? |
If you want to test wiremock, you can try preview version 1.8.14-ci-110308 See |
I'll set a reminder and do that tomorrow morning! |
@StefH I used this new preview version for a test with my code and it worked like a charm: Thanks so much, ready to release this as far as I'm concerned. |
No description provided.