IntelliJ IDEA 2017.3: JUnit support

Posted on by Zlata Kalyuzhnaya

The JUnit 5 testing framework was released on September 10. However, IntelliJ IDEA has had support for JUnit 5 for quite some time, and the latest v2017.3 provides even more goodies – inspections and quick-fixes to make it easier for you to migrate your JUnit 4 tests to JUnit 5.

Screen Shot 2017-11-14 at 17.11.48

Screen Shot 2017-11-14 at 17.12.28

Moreover, almost all inspections available for Java | JUnit have been updated and now work for JUnit 5 as well.

Run JUnit tests in Run Dashboard

In IntelliJ IDEA 2017.3, you can run tests inside the Run Dashboard tool window. Add a JUnit run configuration to the Run Dashboard Types in the Run/Debug Configurations window.

Screen-Shot-2017-10-24-at-13.22.37

Now the IDE allows you to run, stop, pause, or terminate tests from the Run Dashboard. The left-hand pane of the Run Dashboard tool window displays tests within the current run/debug configuration. A special icon indicates the status of each test. When tests are running, you can observe the progress of each test and view the number of passed or failed tests right in the Run Dashboard. For the output of the test, look in the right-hand pane.

rundashboard-junit

To give these new features a try, download the IntelliJ IDEA 2017.3 EAP build. As always, your feedback is very welcome in our issue tracker. Thanks!

 

 

Comments below can no longer be edited.

9 Responses to IntelliJ IDEA 2017.3: JUnit support

  1. Robin says:

    November 15, 2017

    The JUnit5 migration feature sounds great. Would be even greater if it was also possible to migrate all unit tests per project/folder/module.

    • Anna Kozlova says:

      November 16, 2017

      Sure you can do that, just run an inspection over chosen scope (Analyze| Inspect Code/Run inspection by name) and apply the quick fix.

      • Robin says:

        November 16, 2017

        Awesome!

  2. nullpointer says:

    November 17, 2017

    IntelliJ IDEA 2017.3 EAP (Community Edition)
    Build #IC-173.3727.22, built on November 15, 2017
    JRE: 1.8.0_152-release-1024-b6 x86_64
    JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
    Mac OS X 10.10.5

    Still doesn’t suggest me to migrate the Junit4 tests to Junit5. Any prerequisites not mentioned in the above post?

    • Anna Kozlova says:

      November 17, 2017

      You need to have junit 5 on the classpath for inspection to raise a warning.

  3. Niko Dima says:

    December 1, 2017

    I have now problems with running junit5 tests that were perfectly running on 2017.2:

    WARNING: TestEngine with ID ‘junit-jupiter’ failed to discover tests

    • Anna Kozlova says:

      December 1, 2017

      Please submit issue with sample project (dependencies and sample test case only). Thanks

  4. Niko Dima says:

    December 1, 2017

    platform.commons.util.PreconditionViolationException: Could not load class with name:

  5. Adrian says:

    August 2, 2018

    Hello,

    I have the same problem with intellij 2018.1.5.

    Could you please share the solution with me? I’m using a maven project with junit 5 for selenium testing

    br

    Adrian

Subscribe

Subscribe for updates