Inspectopedia
 
2024.3

JUnit API usage from multiple versions in a single TestCase

Warning
Sanity
New
Last modified: 03 December 2024

Reports JUnit annotated methods when used in a test case from a different JUnit version. To determine the framework version for a test case the inspection checks the framework version of the super class when available. When a super class is not available it will use the most used framework in the test case.

Example (JUnit 4 annotation in JUnit 3 test case):

After the quick-fix is applied:

Example (JUnit 5 annotation in JUnit 4 test case):

After the quick-fix is applied: