JUnit Mixed Versions
ID |
java.junit_mixed_versions |
Severity |
low |
Remediation Complexity |
trivial |
Remediation Risk |
low |
Remediation Effort |
low |
Resource |
Reliability |
Language |
Java |
Tags |
best-practice, junit, testing |
Description
Reports classes that mix JUnit 4 (org.junit.) and JUnit 5 (org.junit.jupiter.) annotations. Only one test framework runner is active per class, so the annotations from the other framework are silently ignored.
Rationale
Reliability — Setup, teardown, or test methods annotated with the inactive framework version will not execute, leading to incomplete test coverage.