Fix MappingConverter to support Body with JsonMatcher (#1101)

* Fix MappingBuilder for Body

* .

* .

* Fix MappingConverter
This commit is contained in:
Stef Heyenrath
2024-05-08 17:40:53 +02:00
committed by GitHub
parent 9210957e55
commit e20a90b615
11 changed files with 300 additions and 70 deletions

View File

@@ -0,0 +1,30 @@
var server = WireMockServer.Start();
server
.Given(Request.Create()
.UsingMethod("GET")
.WithPath("/foo")
.WithParam("test", "it.Length < 10")
)
.WithGuid("41372914-1838-4c67-916b-b9aacdd096ce")
.RespondWith(Response.Create()
.WithBody("{ msg: \"Hello world!\"}")
);
server
.Given(Request.Create()
.UsingMethod("POST")
.WithPath("/users/post2")
.WithBody(new JsonMatcher(
value: new
{
city = "Amsterdam",
country = "The Netherlands"
},
ignoreCase: false,
regex: false
))
)
.WithGuid("98fae52e-76df-47d9-876f-2ee32e931d9b")
.RespondWith(Response.Create()
);