Scaling Integration Tests: Parallel Spring Tests with JUnit & Testcontainers
Integration tests can quickly become slow, especially when every test starts its own Spring Boot context and Testcontainers instances. In this session, we’ll have a look at how to run such tests in parallel using JUnit 5, Testcontainers and WireMock. We’ll talk about what needs to be in place for parallel execution to work reliably: how to avoid flaky tests, keep them independent, and reuse containers and application contexts where possible. We’ll also look at how JUnit extensions can help set up isolated environments for each test, without dragging our test suite down. Finally, we’ll share some lessons learned from real projects. What worked, what didn’t, and when the extra effort for parallel execution actually pays off.