Ability to provide pre/post triggers in the example files to setup a data fixture for each test #1333
Krazybug
started this conversation in
Ideas and Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Maybe this is something that I've maybe missed in your tool, sorry in that case.
When you wish to run your tests against an OpenAPI spec you can rely on examples in the spec or on external examples as json/yaml files.
This is very convenient as you can reuse all of this as mocks for the consumer and you provide advance service virtualisation features.
However, on the provider side you're constrained by these examples and you have to populate a consistent dataset across all the test cases and you can't rely on the execution order of them. You can reset an in memory db between each requests in a specific environment (Spring contexts, ...) but it is not really satisfying as it is not totally agnostic neither representative of your real environment (UAT, Pre Prod)
It would be nice to support two new fields in the examples schema, which could eventually invoke a sequence of internal endpoints to setup/cleanup the data for each test. Not necessarily to inject some code, but just a sequence of requests to internal resources as it is considered as a good practice.
Thanks for your feedback.
Beta Was this translation helpful? Give feedback.
All reactions