Writing test driven apps with http4k
summary
http4k is a Kotlin library that models servers and clients as the same function so tests run in-memory http handler tests at ~8ms instead of ~150ms over the network. Example builds: a routed app, an atomic Integer call-counter implemented as a Filter, JSON marshalling via JSON lenses, and a fake dictionary HTTP handler used for contract tests and failure injection. All pieces compose as handlers so tests stay fast, deterministic, and reusable across unit and integration contexts.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 3:52Overview
- 8:43What is http4k
- 11:08App overview
- 12:02Prerecorded coding
- 12:22Creating a test
- 13:13Creating a request
- 18:34Creating a second test
- 21:31Crosscutting middleware
- 22:22Filters
- 24:22Call counter filter
- 29:54Reuse test code
- 37:11Testing the analyzer
- 40:36Introducing the lens
- 47:36Introducing the dictionary
- 53:14Building a fake dictionary
related talks
39mWriting Test Driven Apps with http4k
44mExploring the Testing Hyperpyramid with Kotlin and http4k
45mDeveloping Ultra-Light REST Microservices in Pure Kotlin
48mServer as a Function in Kotlin
24mKomparing Kotlin Server Frameworks
37mKotlin on the server with Ktor
37mLeveraging Kotlin to write maintainable UI tests
47mKotlin Server Framework Smackdown
