Spring Boot testing: Zero to Hero
summary
Shows how to stop tests from turning into a 12‑minute flaky nightmare by using Spring Boot’s real toolkit: @SpringBootTest vs @WebMvcTest slices, MockMvc (and the new MockMvc tester) for HTTP checks, HTMLUnit WebClient for lightweight JS, and Testcontainers with DynamicPropertySource to run Postgres full‑text search. Demonstrates the 3s “slow bean” that reveals the context cache (default size 32), recommends singletons for heavy containers, uses Awaitility instead of Thread.sleep, and uses OutputCaptureExtension, AssertJ and Mockito deep stubs; security uses WithMockUser and oidcLogin post‑processors.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 5:55Basic MockMvc testing
- 12:12Lightweight browser testing
- 20:49Full web server testing
- 30:42Optimizing test speed
- 39:59The testing toolbox
- 47:47Custom assertions
- 57:12MockMvc Tester and Awaitility
- 1:08:48Slice testing
- 1:22:32Testcontainers integration
- 1:56:05Toolbox revisited
- 2:03:22Configuration testing
- 2:30:15Security testing
related talks
01h 49mSpring Boot testing: Zero to Hero
53mTesting Spring Boot Applications Demystified
45mSpring Boot Test - A look behind the curtain
33mThings I Wish I Knew When I Started Testing Spring Boot Applications
48mTesting Spring Boot Applications Demystified
51mTesting Spring Boot Applications
50mTesting Spring Boot Applications
44mTDD with Spring Boot - Testing the Harder Stuff
