Spring Boot tests with Testcontainers and PostgreSQL, MySQL or MariaDB
Testcontainers is a Java library that allows integrating Docker containers in JUnit tests with ease. In a Containerized World , there is little sense to complicate the tests configuration with embedded databases and services. Instead, use run your services in Docker and let the Testcontainers manage this for you. In this blog post you will learn how to configure Testcontainers to run PostgreSQL, MySQL and MariaDB in Spring Boot 2 integration tests. This blog post covers: Testcontainers configuration (via JDBC URL Scheme ) for Spring Boot 2 tests with PostgreSQL , MySQL and MariaDB Testcontainers in @DataJpaTest