JUnit Parameterized No Data
ID |
java.junit_parameterized_no_data |
Severity |
low |
Remediation Complexity |
trivial |
Remediation Risk |
low |
Remediation Effort |
low |
Resource |
Reliability |
Language |
Java |
Tags |
best-practice, junit, testing |
Description
Reports classes annotated with @RunWith(Parameterized.class) that do not contain a static method annotated with @Parameters. The Parameterized runner requires a data provider method to supply test data. Without it, the runner throws an exception at startup.
Rationale
Reliability — The test class will fail to initialize and no tests will execute, giving a false impression that the test suite is complete.