~/talk

Supercharge Spring Boot Tests with Kotlin DSL Power

Talkat Spring I/O 2026 · 2026-04-13..04-15· [kotlin, testing]
name:Urs Peter
links:none on file
slides:none on file

Shows concrete techniques and tooling: replace JUnit assertEquals with Kotest matchers for richer, type-aware failures; use the PowerAssert compiler plugin to expand boolean assertions into detailed diagnostics; prefer Kotlin data classes + copy and default/named arguments over Java builders to get mandatory-argument safety; use type-safe builders for complex test graphs; use reified types to simplify JSON deserialization; swap Reactor/StepVerifier tests for coroutines with awaitAll for sequential-style, non-blocking tests. Claims about results: about 30% fewer lines and a conversion script that is ~95% accurate (repo linked).

AI-written summary · about

  1. 0:00Introduction
  2. 1:51Test code proportion
  3. 3:36Why Kotlin for tests
  4. 4:40Kotest matcher DSLs
  5. 8:58Kotlin vs AssertJ
  6. 11:48PowerAssert for failures
  7. 13:54Type-safe reflection
  8. 15:17Simpler test data
  9. 21:24Copying test data
  10. 26:20Custom test extensions
  11. 32:01Reified types for serialization
  12. 35:54Type-safe builders
  13. 41:57Testing reactive code
  14. 47:31Exploratory testing
  15. 49:20Benefits and conclusion
~/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.