mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
WireMock.Net.Client Request Builder Matchers #604
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 @hmiguel on GitHub (Jun 5, 2024).
Originally assigned to: @StefH on GitHub.
Hello,
I'm trying to replicate the following server mapping using wiremock.net rest client.
Right now, I successfully made it using @R0boC0p extension from here. It look like this:
My question is: is there any built-in way to do it?
@R0boC0p commented on GitHub (Jun 5, 2024):
I am not sure if I can follow correctly, but if you are intending to have a builder for the admin-interface, this has been added by the link you posted, and there is no extension code (the one that I proposed) needed, as it's now working out of the box.
What is your exact issue, as your code seems to be just fine?
from what I can see the only difference here is that the example code has
Cheers.
@hmiguel commented on GitHub (Jun 6, 2024):
My issue is that you don't have an
api.MappingBuilder(), only aapi.GetMappingBuilder();And then,
api.GetMappingBuilder()doesn't have the same syntax, neither access toWithBody(IMatcher matcher), i.e..Best
@StefH commented on GitHub (Jun 6, 2024):
For an example on the mapping builder: see https://github.com/WireMock-Net/WireMock.Net/blob/master/examples/WireMock.Net.Client/Program.cs#L22
@hmiguel commented on GitHub (Jun 7, 2024):
@StefH I can't see any example with body using matchers, only strings, i.e.
.WithBody(new JmesPathMatcher("things.name == 'RequiredThing'"))).@StefH commented on GitHub (Jun 7, 2024):
Correct, the JmesPathMatcher (from the server project) is not available if you use the client builder.
If you only have use client-side, you need code like this:
@hmiguel commented on GitHub (Jun 7, 2024):
If so, I prefer to use @R0boC0p extension. Thanks
@StefH commented on GitHub (Jun 7, 2024):
As stated by @R0boC0p, that extension is not available. The only code which is available on the client is the code I posted.
@StefH commented on GitHub (Jun 7, 2024):
https://github.com/WireMock-Net/WireMock.Net/pull/1116