JUnit 5 extensions: from conditional test execution to test templates
summary
JUnit 5 ships a new extension model that actually implements conditional execution via system property (extensions evaluate runtime annotations and return enabled/disabled with reasons), lifecycle callbacks that start and stop Docker containers and persist the container ID in a namespaced store (container start/stop stored by namespace), parameter resolvers that inject Docker network settings and TestReporter, custom argument providers reading JSON via Jackson, and test templates that run randomized checks (example default 100 randomized invocations) to find counterexamples — all demos run in IntelliJ/Maven and the Docker examples start, test, and clean up successfully.
AI-written summary · about
chapters (25)
- 0:00JUnit 5 release news
- 1:06JUnit 5 modules overview
- 2:29Extension model introduction
- 4:54Conditional test execution demo
- 9:39Extension context details
- 11:03Global extension registration
- 13:34Reusable test setup
- 18:13Extension data storage
- 21:05Parameter resolver demo
- 24:12Dynamic ports with extensions
- 28:48Parameterized tests overview
- 30:56Custom arguments source
- 34:10Test templates introduction
- 35:17Property-based testing
- 41:46Test templates use cases
- 43:13Extension support tools
- 43:33JUnit 5 extensibility summary
- 44:57Resources and feedback
- 46:07Q&A Docker extension
- 47:47Q&A test execution model
- 48:51Q&A custom test engines
- 50:21Q&A parallel execution
- 51:28Q&A scenario tests
- 52:54Q&A Java 9 support
- 53:57Q&A Killian project
