Affects PMD Version: 7.9.0
Rule: JUnit5TestShouldBePackagePrivate
Description:
I have a base class which has the test method and there are a lot of child classes to it which just provides parent test case required arguments, if these child classes are not package private, pmd rule doesn't report it as violation because these classes doesn't contain a @Test method.
Code Sample demonstrating the issue:
public abstract class AbstractModuleTest {
@Test
void testModule() {
assertEquals(value(), value());
}
protected abstract int value();
}
public class ModuleImplTest extends AbstractModuleTest {
@Override
void value() {
return 1;
}
}
Expected outcome:
In the above case ModuleImplTest is not package private and should be reported.
Running PMD through: maven
Affects PMD Version: 7.9.0
Rule: JUnit5TestShouldBePackagePrivate
Description:
I have a base class which has the test method and there are a lot of child classes to it which just provides parent test case required arguments, if these child classes are not package private, pmd rule doesn't report it as violation because these classes doesn't contain a
@Testmethod.Code Sample demonstrating the issue:
Expected outcome:
In the above case ModuleImplTest is not package private and should be reported.
Running PMD through: maven