~/talk

Scaling Integration Tests: Parallel Spring Tests with JUnit & Testcontainers

Talkat JCON EUROPE 2026 · 2026-04-20..04-23· [testing, devops-and-delivery]
links:none on file
slides:none on file

Uses JUnit 5, Testcontainers and WireMock to run Spring Boot integration tests in parallel by reusing containers via a singleton container approach (static singletons or a JUnit extension), selectively enabling JUnit concurrency, and reusing Spring contexts. Calls out gotchas: Mockito mocks are not thread safe and avoid deleteAll/findAll and broad MockitoBean resets. On a real project with 12 test classes / 76 methods this cuts the test step from 46s to 22s while one stubborn test remains non-parallelizable.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 1:39Reusing test containers
  3. 7:34Implementing singleton patterns
  4. 10:22Parallelizing JUnit tests
  5. 13:29Achieving test isolation
  6. 20:05Test isolation workflow
  7. 23:16Tooling for test stability
  8. 25:39Optimizing Spring contexts
  9. 30:09Summary and advanced tuning
  10. 37:50Questions and answers
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.