How Uber Migrated 1.25M Lines from JUnit 4 to 5 with OpenRewrite
summary
Uber migrates over 75,000 test classes and 1.25 million lines from JUnit 4 to JUnit 5 using OpenRewrite with Bazel integration, producing more than 5,000 PRs. The effort fixes Lombok and type attribution bugs in OpenRewrite, adds precondition recipes to skip non-migratable classes, writes custom recipes for external resource rules and test containers, and orchestrates campaigns with Shepherd so each PR updates source and Bazel deps, validates build and tests, and lands deterministically.
AI-written summary · about
chapters (10)
- 0:00Introduction to JUnit migration
- 4:16Why migrate to JUnit 5
- 8:07Choosing OpenRewrite for migration
- 10:55Recipe development and fixes
- 19:17Recipe patterns and replacements
- 23:51Orchestrating build configurations
- 27:03Executing migration at scale
- 30:53Campaign results and feedback loop
- 33:19Key takeaways and future work
- 35:01Spring Boot 2 to 4 migration approach
related talks
15mMajor migrations made easy
17mMajor migrations made easy
34mPull Off the Split: Succeeding with OpenRewrite
51mMajor Migrations Made Easy
31mPull Off the Splits with OpenRewrite
49mJUnit: time to shift into 5th gear!
28mAutomated Java Upgrades: From Pain to Productivity in 30 Minutes
35mJunit5: the next gen of testing, don't stay behind
