JUnit has been around for a long time, and many applications will have a large number of JUnit tests written using JUnit 4. JUnit 5 was released in 2017, and provides a lot of features that weren’t in the previous version. Let’s look at how to migrate existing JUnit 4 tests to JUnit 5.

This screencast covers:

  • Updating the project’s dependencies to run existing JUnit 4 classes on the JUnit 5 platform (via Maven);
  • Migrating an individual test from JUnit 4 to JUnit 5 using IntelliJ IDEA’s inspections
  • Migrating all a project’s test using IntelliJ IDEA’s migration tool;
  • Creating a Find in Path query to identify places that use JUnit 4 features that need to be manually migrated.

Download IntelliJ IDEA: https://jb.gg/download-intellij-idea
Top 15 IntelliJ IDEA shortcuts: https://youtu.be/QYO5_riePOQ

#intellij

IntelliJ IDEA. Migrating from JUnit 4 to JUnit 5 (2020)
4.05 GEEK