Junit5: the next gen of testing, don't stay behind
summary
Explains why JUnit 5 actually rewrites execution: it splits platform, Jupiter API and a vintage engine so JUnit4 tests keep running; shows concrete features used at work — @Nested for readable specs, assertAll and assertThrows, parameterized and dynamic tests — and demonstrates Gradle Android support via Marcel Schneller’s plugin but with instrumentation requiring min SDK 26 and Espresso still needing rule-to-extension workarounds. Builds a custom engine to run Robolectric (works but doubles discovery), and recommends writing new tests in JUnit5 and migrating rules to extensions.
AI-written summary · about
chapters (21)
- 0:00Introduction and speaker background
- 1:11History of JUnit from 1994 to 2016
- 6:12JUnit Lambda crowdfunding and JUnit 5 vision
- 8:59Key changes in JUnit 5
- 10:25JUnit 5 test output and display names
- 12:10New assertions and assumptions in JUnit 5
- 13:54Tagging and conditional tests
- 15:19Nested tests feature
- 16:43Experimental features in JUnit 5
- 19:09Migrating from JUnit 4 to JUnit 5
- 20:32Rules and runners in JUnit 5
- 22:41Extensions as new rules
- 23:25JUnit 5 support in Android
- 24:07Instrumentation tests in Android
- 24:47Espresso tests and limitations
- 26:10Mobile Electric and JUnit 5
- 27:12Custom class loading challenges
- 28:56Test instance factory in JUnit 5.3
- 30:46Creating custom JUnit 5 engines
- 32:52Should you migrate to JUnit 5?
- 33:55Resources and closing remarks
related talks
28mMoving Forward with JUnit 5
36mA New Era of Testing
51mJUnit 5
48mDeep Dive into JUnit 5
01h 06mJUnit 5 — New Opportunities for Testing on the JVM
51mJUnit 5 — The New Testing Framework for Java and Platform for the JVM
44mJUnit 5: The Next Step in Automated Testing for Java
48mJUnit 5: New Opportunities for Testing on the JVM
