Search code examples
javaintellij-ideajunitjunit4junit5

How do I get the "Migrate to JUnit 5" option to appear in Intellij IDEA?


According to these release notes Intellij 2017.3 and later should have a feature that enables easy migration from JUnit 4 to JUnit 5 (a.k.a. JUnit Jupiter).

Migrate to JUnit 5 Intellij IDEA inspection

However, that's not appearing for me. How do I get it to show up?


Solution

  • If it's not showing up, then the inspection is turned off. You can enable it in the Settings by going to:

    Editor → Inspections → Java → JUnit → JUnit 4 test can be JUnit 5

    Turning on the "JUnit 4 test can be JUnit 5" inspection in Intellij IDEA

    Also, make sure that JUnit Jupiter is on your classpath.