Added support of custom matchers in static mappings (#713)

* Added support of custom matchers in static mappings

* Fixed code style issues

* Fixed naming and code style

* added empty line

* Ignore serialization of CustomMatcherMappings property in WireMockServerSettings

* Added integration tests for CustomMatcherMappings
This commit is contained in:
Levan Nozadze
2022-01-17 19:04:37 +04:00
committed by GitHub
parent 60bdc06d29
commit 6b393ebc1d
7 changed files with 321 additions and 0 deletions

View File

@@ -105,6 +105,11 @@ namespace WireMock.Serialization
return new SimMetricsMatcher(matchBehaviour, stringPatterns, type, throwExceptionWhenMatcherFails);
default:
if (_settings.CustomMatcherMappings != null && _settings.CustomMatcherMappings.ContainsKey(matcherName))
{
return _settings.CustomMatcherMappings[matcherName](matcher);
}
throw new NotSupportedException($"Matcher '{matcherName}' is not supported.");
}
}