[java] TestClassWithoutTestCases - false-positive for test classes extending a class with tests (in nested classes) #5011
Labels
a:false-positive
PMD flags a piece of code that is not problematic
Affects PMD Version: 7.1.0
Rule: TestClassWithoutTestCases
Description:
In PMD 6 this was no issue, now in PMD 7 a nested test class is now detected as TestClassWithoutTestCases. I guess previously the class was not detected as test class at all. Now it is detected, and yes it actually has no tests, but they are on the super class.
Code Sample demonstrating the issue:
Expected outcome:
No violations, as the super class actually has test cases
[INFO] PMD Failure: works.reload.recore.util.operations:22 Rule:TestClassWithoutTestCases Priority:3 The class 'operations' might be a test class, but it contains no test cases..
Running PMD through: Maven
The text was updated successfully, but these errors were encountered: