I'm trying to move Spring Boot app to Quarkus. In tests we have @Sql annotations which are called before / after particular @Test method. Is there anything what resembles this functionality in Quarkus? All I can find are examples of creating whole database before tests, but what I want is to be able to insert / delete records to / from db before / after each test method.
Asked
Active
Viewed 776 times
1 Answers
2
At the moment, we don't have that feature in Quarkus yet.
I wrote a JUnit5 Extension which uses Flyway to do exactly that. Please check: https://github.com/radcortez/flyway-junit5-extensions and the Quarkus example: https://github.com/radcortez/flyway-junit5-extensions/tree/master/examples/quarkus

Roberto Cortez
- 803
- 4
- 8
-
Thanks for the answer, for now I'm thinking in direction of writing util class which executes sql scripts and call it manually: https://stackoverflow.com/questions/24936956/jpa-entity-manager-how-to-run-sql-script-file – Kamil Jan 06 '21 at 10:42