~/talk

Mocks vs Testcontainers

Talkat JPoint 2022 · 2022-06-13..06-24· [testing]
slides:none on file

Compares Testcontainers (real services in Docker) with mocks (fast in-memory fakes), showing concrete tradeoffs: Testcontainers reproduce production behavior but add slow pulls, require Docker and flaky startup times; mocks start instantly, let tests inject failures and verify calls, but often miss protocol corner cases (Redis mock lacked some commands). Kafka examples show a synchronous test driver that can give false confidence for async streams; Awaitility speeds and stabilizes async checks but cannot remove fundamental flakiness. Recommends mixing tools and preferring emulators when available over relying only on H2.

AI-written summary · about

  1. 0:00Introduction
  2. 2:13Mocks vs Testcontainers
  3. 6:08Integration tests
  4. 11:05Mocks versus real systems
  5. 18:26Preliminary considerations
  6. 19:09Example 1: Redis and JetBrains Xodus
  7. 23:55Example 2: Kafka and Testcontainers
  8. 33:18Example 3: Apache Beam and DirectRunner
  9. 40:03Example 4: Celesta as mock backend
  10. 48:57Summary
  11. 52:32Q&A
~/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.