You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
switch (responseModel.StatusCode)
{
case int statusCodeAsInteger:
responseBuilder = responseBuilder.WithStatusCode(statusCodeAsInteger);
break;
case string statusCodeAsString:
responseBuilder = responseBuilder.WithStatusCode(statusCodeAsString);
break;
}
When stepping through the code, responseModel.StatusCode is 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.
The text was updated successfully, but these errors were encountered:
FrostyZoob
changed the title
Bug: StatusCode not built correctly when loaded from mapping file.
StatusCode not built correctly when loaded from mapping file.
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.StatusCode
is 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.The text was updated successfully, but these errors were encountered: