mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
[FluentAssertions] Should().HaveReceivedACall().WithHeader() only checks the first header with the matching key. #524
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tlevesque-ueat on GitHub (Jun 22, 2023).
Describe the bug
I have a scenario where I send 2 different requests to wiremock.
One has the header
Authorization: Bearer invalidTokenThe other has the header
Authorization: Bearer validTokenI'm trying to assert that I received a request with each of these headers:
However, the second assertion fails, because
WithHeader()only checks the firstAuthorizationheader of all received requests.Expected behavior:
Both these assertions should succeed.
WithHeadershould check the headers of all requests, not just the first.Test to reproduce
Other related info
Provide additional information if any.
@StefH commented on GitHub (Jun 22, 2023):
Thanks for this detailed issue.
A fix will be released in the next version.
https://github.com/WireMock-Net/WireMock.Net/pull/959
@tlevesque-ueat commented on GitHub (Jun 26, 2023):
Wow, that was fast! Thanks