-
-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help converting a slightly more complex Wiremock.org template #752
Comments
@mattisking And currently WireMock.Net works like : any are matching. Correct? |
That’s correct. It’s doing an OR match and I need an AND match. some test cases I’ll need to set 5 or more AND matches. I also started on building the response. Using one of the examples I was looking at the random data generator which seems to work when using BodyAsJson, but there’s no BodyAsXml option and just using Body doesn’t seem to work? (I forgot how much a pain namespaces in Xml are.) This is an external service I’m mocking. Our services are Json based but I can’t control this one. |
|
As long as there is a way to change it between OR and AND (or average) I’m not sure that it matters. But from a logical perspective, if each item in the config is a “Matcher” of some sort I would personally expect it must follow all the matches to match. That’s my personal belief. If this is the way it works today, however, changing it might break it for others if they update in the future… that might be more a pain then me adjusting these templates out of the gate.
|
@mattisking |
@mattisking See preview version: It can be used like: "Body": {
"Matchers": [
{
"Name": "ExactMatcher",
"Pattern": "a"
},
{
"Name": "ExactMatcher",
"Pattern": "b"
}
],
"MatchOperator": "Or"
} |
@mattisking |
I will be testing it this weekend. Overwhelmed with a large release the past few days. Thanks a lot for looking into this. |
@mattisking Thank your very much. |
So far this is working well. I've tried out a couple of scenarios and I'll go ahead and bang out a few more from our scripts. |
I'll just keep this open for now, in case you encounter other issues. |
@mattisking |
Not so far. I appreciate the effort. I like wiremock and in this case you’ve really added some nice additions. Now we should build on wiremock studio 😉 |
@mattisking I'll merge the PR and create a new version (1.5.0) wiremock studio ? You mean a version for this WireMock.NET ? |
Yes I just mean that the open source wiremock studio isn’t bad and is a decent editor. One of the things I’m working to accomplish is to empower our QA people with tools to build their own mocks for their test cases. That’s a stretch goal. I’m more than capable of editing template files. |
Maybe a good use case to build this in .net Maui 😀 |
I'm experimenting using this instead of wiremock.org and am doing some POC stuff. I've hit a couple of problems with Body matching using XPath, and I could use some guidance on how to accomplish the response request->response items and dynamically created response parts. I have a template here (cnp.json
config.zip
)
and a partially converted one along with what to post.
https://localhost:9443/vap/communicator/online
The current issue is that my XPath matching rules both have to fail for it to fail to match, but I need ANY rule to cause it to fail. As it stands, if I change one of the values in the post but not the second it still says it's a match. Also, any help with building the response would be great.
cnp.json
The text was updated successfully, but these errors were encountered: