-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Reset single scenario using HTTP request #833
Comments
Hello @iparry7979, This is not yet implemented in the current version, however you can try a preview version which supports:
Where Preview version = "1.5.8-ci-16566". |
@iparry7979 did you have to time to verify this logic in the preview NuGet ? |
@iparry7979 Did you have time to test this? |
Hi @StefH I have done some testing with this preview version. It's not working quite as I expected. I have the following stubs:
What I was expecting was that when I hit the /scenario path multiple times I would get the following responses: Initial state Since when the scenario is in state 3 there is no WillSetStateTo. What I actually got as responses was: Initial state So the on the 3rd call it set the state back to the initial state despite having no instruction to reset the state. I also tested the POST to /__admin/scenarios/ABC/reset. Here were the results:
So the POST to the admin url seemed to just do the same thing as a call to the /scenario path and updated the state to state3. Whereas I expected it should reset the scenario to it's initial state. I may be misunderstanding something about the way it is supposed to work though. |
@StefH Please disregard the second part of my comment above. I had updated Wiremock.Net.Standalone but not WireMock.Net. When I updated the package the POST to /__admin/scenarios/Scenario1/reset worked as expected in version 1.5.8-ci-16566. |
@iparry7979 Thanks for testing. I'll merge PR to master en close this issue. |
I am running WireMock as a standalone app.
Regarding resetting scenarios: I am able to reset all scenarios using an empty POST request such as: POST /__admin/scenarios/reset.
However, it fails when I try to reset a single scenario using an empty PUT request for example: PUT /__admin/scenarios/my_scenario/state
According to the documentation here this should work in the java version. Is this implemented in the C# version? If so am I doing something wrong to reset a single scenario?
The text was updated successfully, but these errors were encountered: