Supercharge Spring Boot Tests with Kotlin DSL Power
summary
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
chapters (15)
- 0:00Introduction
- 1:51Test code proportion
- 3:36Why Kotlin for tests
- 4:40Kotest matcher DSLs
- 8:58Kotlin vs AssertJ
- 11:48PowerAssert for failures
- 13:54Type-safe reflection
- 15:17Simpler test data
- 21:24Copying test data
- 26:20Custom test extensions
- 32:01Reified types for serialization
- 35:54Type-safe builders
- 41:57Testing reactive code
- 47:31Exploratory testing
- 49:20Benefits and conclusion








