0
votes

I'd like to execute some sql scripts to fill up my database for my integration tests. For now with the help of testContainers and data.sql & schema.sql in my tests/resources folder, it's working, but those data filled by data.sql is shared with all my integration tests.

I'd like to execute some sql specifically dedicated to each integ tests.

Is there a facility to do so ?

Else I will execute some sql directly inside my integration test to fill up what I need.

Regards, Blured.

1

1 Answers

1
votes

Have a look at item 5 here. You can use an annotation on a test to load data for that test. Just keep in mind that data will stay for the duration of the test suite run unless you clean it.