-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
New support for sequenced stub actions implemented. #49
Conversation
Fixing guide links and formatting. Updated version of Grizzly dependency to the latest v2.3.24.
I am supporting this idea! +1 for this pull request. |
My blog post about this feature: http://yatel.kramolis.cz/2016/05/restito-sequenced-stub-action.html |
.then().assertThat().body(equalTo("UPDATED VALUE")); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to add a test with at least two different conditions to make sure that the state is not thrown away when another condition kicks in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no problem to add another tests. But to be honest I don't know what you mean by "the state is not thrown away when another condition kicks in". Could describe little bit more verbose test steps? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I just mean:
Setup:
When /foo
Then OK200 and sequence STRINGfoo1, STRINfoo2
When /bar
Then OK200 and sequence STRINGbar1, STRINGbar2, STRINGbar3
Checks:
Get /foo expect STRINGfoo1
Get /bar expect STRINGbar1
Get /foo expect STRINGfoo2
...
And so on...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I hope. ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good. I think it is important to cover this case.
Thanks a lot for the pull request. This is the biggest one so far!👋 I definitely think that thefeature is very useful, and restito needs it. Please take a look at the comments and let me know what you think. Btw, I am writing from the phone now, will get back to 💻 in a few days, please be patient :-) |
I've been thinking about this for couple of days, and then finally got back to the laptop, and could hack a little bit. The main concern now is that by keeping the queue inside the action object, we overload this (originally) very lightweight, well-composable and stateless concept. This, for instance is perfectly fine now, but will become unsafe (because
How to avoid this? Keep configuration objects stateless, and push the state into higher-level concepts (like I'm now doing some refactoring within Stubs-related code, based on your PR. It's still WIP, few tests fail, hope to finish it tomorrow to see how it looks in the end. Care to take a look? https://github.com/mkotsur/restito/compare/shamoh-sequenced-stub-actions |
@mkotsur Ok, let me know if I can help. |
@shamoh @martinjmares are you guys using restito with Java8? I'm thinking about dropping 7 support. Is this fine for you? |
Yes, we are on Java 8. |
Created another pull request (#50) based on these changes. I guess, I don't have permissions to commit to this fork, that's why. |
The feature has been released and available in 0.9.0. |
Hi Mike.
This is suggestion how to extend Action API to support different response for identical requests repeated in sequence.
Let me know if you like the idea or if you prefer to make it different way.
Thanks,
Libor