Spring Boot 3.1.0 introduced support for Testcontainers to simplify local development and testing. Testcontainers helps in writing tests using real dependencies instead of mocks, but it may also increase the test execution time. In this article, I will share some insights on how to reduce test execution time while using Testcontainers. Sample Spring Boot application Let’s assume you have created a Spring Boot project using Spring Initializr by selecting Spring Web, Spring Data JPA, PostgreSQL, Flyway and Testcontainers.
Continue reading »