Database Integration Testing with Testcontainers

Introduction to Testcontainers In this post we'll look at Testcontainers and how it can be used to spin up throwaway test databases for your integration tests. You'll see that Testcontainers offers an excellent alternative to in memory databases, such as H2. In memory databases have benefits in terms of speed and simplicity, but there's one fundamental drawback. Your integration tests use a database technology that is substantially different to the one your application will use in production. Testcontainers allows you to spin up the database of your choice, so that your persistence tests run against the same database technology that you'll use in production. This makes [...]