More Automated Tests in our Pipeline

We curently use the useInMemoryDatabase Sytem Property to switch between a real Database and an In memory database ,though I cant see where useInMemoryDatabase is actually set, but we can still use a SytemProperty to switch between the different test Database containers for MysQL and Postgress .

I think we can set a System Property ie testDatabase = mysql/postgress , we then add more configurations here for Both MySQL and PostgreSQL , and TestContainers will start the given databse instance depending on the value of System Property above ie testDatabase

With this approach , one can even mount an sql dump file that loads demo data into the database container, at startup . Something like here

1 Like