Integration test suites can get slow without anyone deciding they should. Another @SpringBootTest here, some in-memory H2 wiring there, a flaky test "fixed" with a stray @DirtiesContext – and eventually the suite is the thing everyone quietly dreads before merging a PR, flaky on every other CI run, with nobody able to point to the one change that caused it.
Spring Boot integration tests do real work, validating behavior across controllers, services, repositories, databases, and messaging systems. That breadth is what makes them valuable, and it's also what makes them expensive. When you wire together a real application context, connect to databases, and exercise multiple layers in a single test run, costs add up fast. The question is whether those costs are unavoidable or whether your test suite pays for things it doesn't need.
This article walks through the specific mechanisms that make Spring Boot integration suites slow and brittle, and the practical strategies that address them.…