Inspectopedia Help

JUnit

'@RunWith' annotation already exists in a parent class   New in this release

Reports when parent and child classes in a JUnit test hierarchy are annotated with @RunWith.

'assertEquals()' called on array   New in this release

Reports JUnit assertEquals() calls with arguments of an array type.

'assertEquals()' may be 'assertSame()'   New in this release

Reports JUnit assertEquals() calls that can be replaced with an equivalent assertSame() call.

Expected exception never thrown in test method body   New in this release

Reports checked exceptions expected by a JUnit 4 test-method that are never thrown inside the method body.

JUnit 3 'super.tearDown()' is not called from 'finally' block   New in this release

Reports calls of the JUnit 3's super.tearDown() method that are not performed inside a finally block.

JUnit 3 test can be JUnit 4   New in this release

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

JUnit 4 test can be JUnit 5   New in this release

Reports JUnit 4 tests that can be automatically migrated to JUnit 5.

JUnit 5 obsolete assertions   New in this release

Reports any calls to methods from the junit.framework.Assert, org.junit.Assert, or org.junit.Assume classes inside JUnit 5 tests.

JUnit API usage from multiple versions in a single TestCase   New in this release

Reports JUnit annotated methods when used in a test case from a different JUnit version.

JUnit assertion can be 'assertThat()' call   New in this release

Reports calls to Assert.assertEquals(), Assert.assertTrue(), etc.

JUnit malformed declaration   New in this release

Reports JUnit test member declarations that are malformed and are likely not recognized by the JUnit test framework.

JUnit test annotated with '@Ignore'/'@Disabled'   New in this release

Reports usages of JUnit 4's @Ignore or JUnit 5's @Disabled annotations.

Multiple exceptions declared on test method   New in this release

Reports JUnit test method throws clauses with more than one exception.

Old style JUnit test method in JUnit 4 class   New in this release

Reports JUnit 3 style test methods that are located inside a class that does not extend the JUnit 3 TestCase class and contains JUnit 4 or JUnit 5 @Test annotated methods.

Parameterized test class without data provider method   New in this release

Reports JUnit 4 parameterized test classes that are annotated with @RunWith(Parameterized.class) but either do not include a data provider method annotated with @Parameterized.Parameters or this method has an incorrect signature.

Usage of obsolete 'junit.framework.Assert' method   New in this release

Reports any calls to methods from the junit.framework.Assert class.

Last modified: 11 September 2024