When writing tests that rely on a database, you are facing 2 challenges:
One, You need to write meaningful tests that ensure that your application works correctly.
And two, You need to provide a test database for each test run.
I can’t help you with the 1st challenge. You know your application a lot better than I do, and I’m sure you will be able to figure this out.
But I can show you a simple technical solution to provide a test database for each test run. Using the Testcontainers library, you can easily start up a Docker container with your database as part of your tests.
Links mentioned:
Getting Started with Flyway and Version-Based Database Migration: https://thorben-janssen.com/flyway-ge...
Version-Based Database Migration with Liquibase – Getting Started : https://thorben-janssen.com/database-...
Like my channel? Subscribe!
➜ http://bit.ly/2cUsid8
Join the free Member Library:
https://goo.gl/dtyIIC
Read the accompanying post: https://thorben-janssen.com/hibernate...
Want to connect with me?
Blog: https://thorben-janssen.com/
Twitter: / thjanssen123
Facebook: / thorbenjanssenofficial
#Hibernate #JPA #Testcontainers