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
It sounds a bit crazy, but if you PUT a new Mapping through the Admin API you get an Exception if the GUID starts with a or d. This happens because of this line of code:
It trims away characters from the beginning, including a and d. We had flaky unit tests because of that and could't believe it in the beginning when we found that issue ;)
How to reproduce:
Start Wiremock.NET 1.0.27 with Admin API and send Request
System.FormatExceptionGuid should contain 32 digits with4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
at System.Guid.GuidResult.SetFailure(ParseFailureKindfailure,StringfailureMessageID,ObjectfailureMessageFormatArgument,StringfailureArgumentName,ExceptioninnerException)
at System.Guid.TryParseGuidWithDashes(ReadOnlySpan`1guidString,GuidResult&result)
at System.Guid.TryParseGuid(ReadOnlySpan`1guidString,GuidStylesflags,GuidResult&result)
at System.Guid.Parse(ReadOnlySpan`1input)
at System.Guid.Parse(Stringinput)
at WireMock.Server.FluentMockServer.MappingPut(RequestMessagerequestMessage)
at WireMock.ResponseProviders.DynamicResponseProvider.ProvideResponseAsync(RequestMessagerequestMessage,IFluentMockServerSettingssettings)
at WireMock.Mapping.ResponseToAsync(RequestMessagerequestMessage)
at WireMock.Owin.WireMockMiddleware.InvokeInternal(HttpContextctx)
because this get's excuted:
stringguidString="/__admin/mappings/a0000000-0000-0000-0000-000000000000".TrimStart("/__admin/mappings".ToCharArray());// guidString = "0000000-0000-0000-0000-000000000000" (the a get's trimmed away)Guidguid=Guid.TryParse(guidString);// Exception
It sounds a bit crazy, but if you PUT a new Mapping through the Admin API you get an Exception if the GUID starts with
a
ord
. This happens because of this line of code:WireMock.Net/src/WireMock.Net/Server/FluentMockServer.Admin.cs
Line 362 in 12444cc
It trims away characters from the beginning, including
a
andd
. We had flaky unit tests because of that and could't believe it in the beginning when we found that issue ;)How to reproduce:
Start Wiremock.NET 1.0.27 with Admin API and send Request
Then you will receive this error:
because this get's excuted:
What I expect:
Put another GUID there, and it suddenly works:
The text was updated successfully, but these errors were encountered: