mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
Did the ThrowExceptionWhenMatcherFails option got removed from 1.5.16 to 1.5.51? #587
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 @JasonLandbridge on GitHub (Mar 29, 2024).
Originally assigned to: @StefH on GitHub.
Hi there,
I just upgraded to .NET 8 and upgraded Wiremock from 1.5.16 to 1.5.51, but the
ThrowExceptionWhenMatcherFailsoption seems to not be there anymore?Searching the repo for any mention of
ThrowExceptionWhenMatcherFailsseems it has disappeared.Did I miss a breaking change or migration?
Thanks!
@StefH commented on GitHub (Mar 30, 2024):
@JasonLandbridge
Sorry, this was indeed a small breaking change introduced in https://github.com/WireMock-Net/WireMock.Net/pull/986 in version 1.5.36 (21 September 2023).
This property was removed, and now you get logging in case the matcher fails.
@JasonLandbridge commented on GitHub (Mar 30, 2024):
@StefH Thanks for tracking this down! I actually loved this option as it would make my tests fail if an URL changed or a new URL was called by my code not yet covered by my tests. But now, I assume, the tests can still pass due to the lack of a thrown exception if this happens.
Any chance this option can be returned or is there something similar available?
Cheers!
@StefH commented on GitHub (Mar 30, 2024):
The functionality is like:
constructor
When creating a matcher using the constructor, and the pattern is invalid, an exception is thrown immediately.
Like:
during matching
When the input value for the matcher to match on, is invalid, the exception is remembered and returned in the result.
Like:
In the high level mapping matcher code, this error/exception is logged and this mapping is skipped because it contains errors.
Does this help you, you did you actually use it in a different way ?
Because I do not understand this:
@JasonLandbridge commented on GitHub (Apr 3, 2024):
Thank you very much for this answer! I will try it out when I have the chance. I will close this for now