mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
StatusCode not built correctly when loaded from mapping file. #240
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 @FrostyZoob on GitHub (Jan 9, 2020).
Scenario:
Using WireMock.Net v1.1.0.0
All requests that match the attached mapping (Returns500Response.txt) get a response whose StatusCode is 200.
Expectation:
The response should have the StatusCode that is specified in the mapping file. (500)
Analysis:
The problem appears to be here: (WireMockServer.Admin.cs, line 811)
When stepping through the code,
responseModel.StatusCodeis 500. (Which is correct.) However, according to the debugger it has been deserialized as a long. Because of that, it skips over the switch statement entirely and responseBuilder.ResponseMessage.StatusCode ends up being set to 200.@StefH commented on GitHub (Jan 9, 2020):
Thanks a lot for finding this issue!
@StefH commented on GitHub (Jan 9, 2020):
PR was already created, merged to master.