-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Adding admin route for resetting a specific scenario by name #1079
Conversation
@tomakehurst not sure why travis is failing, tests are passing locally for me. Am I missing a step before I should have created the PR? |
Looks like travis is failing because: java.lang.IllegalArgumentException: resource swagger/wiremock-admin-api.json not found. Is this file supposed to be autogenerated? |
Got the build passing however not sure it is the best solution. The issue was that the |
Hi @tomakehurst @matthewwilson, Best Regards, |
Hi ,@tomakehurst @matthewwilson, |
@FrankSandou there's a workaround for this which is to create a stub (mapped to a URL that's not in the API you're mocking) that resets the relevant scenario when you request it. |
I need for one scenario reset state , not for all , could you add this feature in release (hotfix) @tomakehurst Best regards, Frank |
The workaround is for resetting single scenario state. |
Best regards, Frank |
No, I mean the workaround I described works for a single scenario. You don't need this PR to be merged to be able to set a single scenario's state - just create a stub that does that for you. |
Hmm, how i can reset one state for one scenario, if i have 5 scenarios with different states?, only this fix, please merge this , i need this very , and wait for this api routing ... @tomakehurst Best regards, Frank |
I'm sorry, but I'm not planning to do a WireMock release in the timeframe you're hoping for. I suggest you configure a stub for each scenario you want to reset and the make a request that matches the appropriate stub when you want to perform the reset. |
@tomakehurst are you planned release in next year January or February ? |
@FrankSandou it looks like the workaround suggested by @tomakehurst will work. Let's say you have a stub that is in a state called "state-1" and you want to reset it back to "started". Simply define another stub that exists purely to reset the state. E.g.
|
This PR adds a new admin endpoint:
POST /scenarios/reset/{scenarioName}
This will reset the state of the given scenario name.
I believe this will fix issue #847 as well as suit a use case for our own project.