
Stop Lying to Your Tests: Real Infrastructure Testing with Testcontainers (Spring Boot 4)
In the age of AI-assisted development, writing code has never been faster. But here is the uncomfortable truth that most teams discover only after production incidents: AI generates implementations. It cannot decide what your tests should verify. That responsibility of knowing what to test, with what fidelity, and why belongs to engineers with platform knowledge and architectural judgment. Nowhere is this more visible than in integration testing. This article is about a shift I see as non-negotiable for teams building reliable backend services in 2026. The Deceptive Comfort of H2 For years, the default Spring Boot integration testing pattern looked like this. Add H2 to the classpath, point your tests at an in-memory database, and tests run fast. No Docker. No external dependencies. Everything green. The problem is that H2 is not your production database. It does not enforce the same constraint semantics. It does not support all SQL constructs your migrations use. It does not run your s
Continue reading on Dev.to
Opens in a new tab



