How to Write Tests in 2021
summary
Advocates moving to JUnit 5 and AssertJ, demonstrating AssertJ’s fluent API and assertAll soft assertions to reveal multiple failures together. Covers mutation testing with PIT to detect weak tests, using Awaitility (Kotlin DSL) and a Java time agent to freeze/shift time for deterministic tests, WireMock-style stubs for integration testing, snapshot tests to lock object graphs, and concrete configuration tips for clearer failure messages.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 3:40Contract testing and hashCode
- 6:51Time and time zones
- 9:18Test naming and docs
- 12:27Assertions and error messages
- 16:38Soft assertions benefits
- 19:49Snapshot tests and refactoring
- 23:00Test frameworks evolution
- 26:12Test docs in CI/CD
- 28:21Property-based testing
- 31:51Mutation testing tools
- 33:15Integration vs unit tests
- 35:42Flaky test detection
- 37:45Architecture and config tests
- 40:17Performance tests and profiling
- 42:46Code analysis tools
- 44:31Summary








