Affects PMD Version:
6.1.0
Rule:
Description:
JUnit 4 rules cause false positive in JUnit 5 tests. It looks like the new annotations for JUnit 5 aren't being handled as they should be.
Code Sample demonstrating the issue:
The file FileFormatType
on the project VocabHunter shows this problem. To work around the problem, the following lines have been added to ruleset.xml:
<rule ref="category/java/bestpractices.xml">
<exclude name="JUnit4TestShouldUseBeforeAnnotation"/>
<exclude name="JUnit4TestShouldUseAfterAnnotation"/>
<exclude name="JUnit4TestShouldUseTestAnnotation"/>
</rule>
To reproduce the problem, remove the above workaround line and then launch the following:
$ ./gradlew clean :core:pmdTest
Running PMD through: Gradle
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4