Inspectopedia 2025.2 Help

JUnit 3 test can be JUnit 4

Reports JUnit 3 test classes that can be converted to JUnit 4 test classes.

Example:

public class MainTestCase extends junit.framework.TestCase { public void test() { Assert.assertTrue(true); } }

After the quick-fix is applied:

public class MainTestCase { @org.junit.Test public void test() { Assert.assertTrue(true); } }

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

Junit4Converter
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | JUnit

This inspection only reports if the language level of the project or module is 5 or higher, and JUnit 4 is available on the classpath.

Suppressing Inspection

You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:

//noinspection Junit4Converter

More detailed instructions as well as other ways and options that you have can be found in the product documentation:

Inspection Details

By default bundled with:

IntelliJ IDEA 2025.2, Qodana for JVM 2025.2,

Last modified: 18 September 2025