Our existing tests run on an in memory h2 database. Which is good because it is simple to set up and the tests run fast.
We need to integrate these exact same tests with MySQL and PostgreSQL (the databases that we currently support) to expose failures that H2 would not ,since H2 doesnt give 100% compatibility with MySQL or PostgreSQL .
One Approach would be to use TestContainers ,a Java library that provides and manages lightweight docker instances of common databases.
This will require adding configuration for MySQL and PostgreSQL here
we can set a System Property ie
to be able to switch between the different databases when running the test.
we can provide the default as `testDb=mysql ` but this can be overriden via the commandline when running tests ie
mvn test -DtestDb=mysql
mvn test -DtestDb=postgresql
see more on the talk thread
FWIW, the ThoughtWorks Technology Radar recommends that we adopt this: https://www.thoughtworks.com/radar/languages-and-frameworks/testcontainers
- mentioned in