Update RequestModelBuilder (add WithHeader) (#1306)

* Update RequestModelBuilder (add WithHeader)

* rejectOnMatch

* fix
This commit is contained in:
Stef Heyenrath
2025-06-05 12:24:40 +02:00
committed by GitHub
parent 6136bc177c
commit 3cc9040f51
3 changed files with 38 additions and 0 deletions

View File

@@ -15,6 +15,19 @@
Methods: [
POST
],
Headers: [
{
Name: Authorization,
Matchers: [
{
Name: WildcardMatcher,
Pattern: *,
IgnoreCase: false,
RejectOnMatch: true
}
]
}
],
Body: {
Matcher: {
Name: JsonPartialMatcher,

View File

@@ -8,6 +8,7 @@ using System.Threading.Tasks;
using FluentAssertions;
using VerifyTests;
using VerifyXunit;
using WireMock.Admin.Mappings;
using WireMock.Client;
using WireMock.Client.Extensions;
using WireMock.Net.Tests.VerifyExtensions;
@@ -41,6 +42,7 @@ public class AdminApiMappingBuilderTests
.WithRequest(req => req
.UsingPost()
.WithPath("/bla1")
.WithHeader("Authorization", "*", true)
.WithBody(body => body
.WithMatcher(matcher => matcher
.WithName("JsonPartialMatcher")