Improved Testcontainers Support in Spring Boot 3.1
There's been support for Testcontainers in Spring Boot for some time now, and Spring Boot 3.1 improves it further. But first, let's take a look at what Testcontainers is and how it's usually used.
Testcontainers is an open source framework for providing throwaway, lightweight instances of databases, message brokers, web browsers, or just about anything that can run in a Docker container.
If you have used Testcontainers in the past, there's a high chance that you have been using them in integration tests:
@SpringBootTest
@Testcontainers
class MyIntegrationTests {
@Container
static…