I have a spring boot project. We are using liquibase for changes to the database. I have started to use testcontainers for integration testing because testing against one single test database (which is the setup we have now) is cumbersome and difficult to maintain.
So far, I have gotten my setup working. The database in a testcontainer is working and creating the tables etc with our existing liquibase changesets is working too. However, I need some initial data in those tables that might differ between test cases. For example when testing our authorisation process I need different data between test cases and when testing some other service I need completely different data all together.
What is the “best” way to approach this? I am leaning towards simply manually inputting data with an SQL statement either with @BeforeAll or in the test method itself, depending on what is needed. Would that make sense to you or are there in your opinion “cleaner” ways of doing it?