~/talk

Spring Boot testing: Zero to Hero

Talkat Devoxx Belgium 2024 · 2024-10-07..10-11· [testing, spring]
slides:none on file

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

  1. 0:00Introduction
  2. 5:55Basic MockMvc testing
  3. 12:12Lightweight browser testing
  4. 20:49Full web server testing
  5. 30:42Optimizing test speed
  6. 39:59The testing toolbox
  7. 47:47Custom assertions
  8. 57:12MockMvc Tester and Awaitility
  9. 1:08:48Slice testing
  10. 1:22:32Testcontainers integration
  11. 1:56:05Toolbox revisited
  12. 2:03:22Configuration testing
  13. 2:30:15Security testing
~/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.