-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Introduce DbTestClient which can be used to reset DB before the next test #28188
Comments
Hey @sberyozkin, I think this duplicates #14240? #15198 seems related as well in some way. Also, there was an attempt to solve this in the past, in #15827 , but it wasn't merged for some reason. |
Hey @yrodiere Sorry, I haven't analyzed what has been done before in this area, and looks like, in #15827, it was assumed it was too complex to do right, with several alternatives considered. |
No problem with restarting the discussion, but let's not duplicate it? I think it would be better to post your API suggestion to #14240, and to link any PR to that. And yes, I think most agree that this feature has value; the disagreement was about execution. I think your solution of a (injected?) client that controls the reset probably solves most issues we had. |
Description
I've started securing
quarkus-quickstarts/hibernate-orm-panache-quickstart
in devmode, withquarkus-oidc
, and by adding@RolesAllowed
to various endpoint methods. The tests delete one of the entities, so running them first asadmin
, and then asuser
does not work, because by the time theuser
is checked, one of the entities has gone.In DevUI, there is a nice option to reset DB, clicking it reruns and SQL script used in the demo.
It would be good, in tests, to have something like
Both tests will pass in any order and with each of them having side-effects. And the reset DB option would be available not only in Dev UI but also in tests
It would be similar to
KeycloakTestClient
which is initialized byDevServices for Keycloak
with the added of Keycloak.Implementation ideas
No response
The text was updated successfully, but these errors were encountered: