~/talk

Idiomatic Kotlin in Tests

Talkat droidcon Berlin 2021 · 2021-10-20..10-22· [testing, kotlin]
links:none on file
slides:none on file

Examples show stepwise refactors from Java JUnit tests to Kotlin using IntelliJ Java→Kotlin converter, replacing JUnit patterns with Kotest stringSpec and forAll for DSL test suites and parameterized lists, swapping Mockito boilerplate for mockito-kotlin or MockK inline mocks and infix assertions, and replacing assertThrows with runCatching/result-based exception assertions so tests become type-safe (data classes for inputs), less noisy, and allow grouped soft assertions and richer failure reports.

AI-written summary · about

  1. 0:00Introduction to idiomatic Kotlin tests
  2. 1:07Refactoring Spring REST controller test
  3. 9:24Parameterized price mapper test
  4. 15:40Testing exception handling
  5. 19:19Key takeaways and libraries
  6. 23:46Further resources and closing
~/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.