~/talk

Integration Testing with Spring

Talkat Java Day Istanbul 2023 · on Saturday, 2023-05-06· [spring, testing]
slides:none on file

Shows concrete Spring TestContext usage with JUnit 5, a Spring Data JPA repo and MySQL/H2 demos showing a repeated test leaving the DB dirty. Fixes compared: @DirtiesContext forces context recreation per test (correct but slow), @Transactional rolls back tests and is much faster in benchmarks from 100 to 2000 rows, but fails if inner calls use REQUIRES_NEW which commits. Also covers TestExecutionListeners needing mergeMode to preserve the transactional listener and using active profiles to swap DB configs.

AI-written summary · about

  1. 0:00Introduction
  2. 1:06Testing pyramid overview
  3. 3:21Spring test context
  4. 4:07Demo setup
  5. 8:46Dirty database problem
  6. 10:53Dirty context solution
  7. 13:23Transactional testing
  8. 21:50Transactional risks
  9. 26:08Transaction listeners
  10. 33:39Custom listeners
  11. 34:00Active profiles
  12. 38:47Summary and Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.