-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Removing specific expectations #42
Comments
Yes it is possible, if you use the clear function it will only remove the expectations that exactly match the request you provide, i.e: mockServerClient.clear(
request()
.withPath("/test")
.withBody(xpath("//test=1"))
); |
Hi, Thanks for the quick response! When I try that using JSON the expectations appears to remain. My JSON for setting the expectation looks like this: My JSON for removing the expectation looks like this: When I ommit the body part the expectation is removed. Jeroen |
ok I'll take a look |
I've been away this weekend but I'll take a look in the next couple of days and add extra tests to make sure there aren't any bugs (or fix them if there are). |
…XPath expectation (it only matched an actual XPath body)
I resolved the issue and added a test for this scenario |
Hi,
I have a question concerning the removing of specific expectations. Is it possible to remove a single expectation for a specific path?
For example: I have set an expectation for path /test with an XPath body match on //test=1. I have set a second expectation for path /test with an XPath body match on //test=2. Is it possible to remove the first expectation without removing the second one, even if no message has been received by the mock server?
Jeroen
The text was updated successfully, but these errors were encountered: