Merge pull request #4705 from adangel/issue-4645-CommentDefaultAccessModifier

[java] CommentDefaultAccessModifier: Fix ParameterizedTest annotation
This commit is contained in:
Juan Martín Sotuyo Dodero
2023-10-19 21:43:13 -03:00
committed by GitHub
3 changed files with 11 additions and 10 deletions

View File

@ -58,6 +58,7 @@ The remaining section describes the complete release notes for 7.0.0.
* java-codestyle
* [#2847](https://github.com/pmd/pmd/issues/2847): \[java] New Rule: Use Explicit Types
* [#4578](https://github.com/pmd/pmd/issues/4578): \[java] CommentDefaultAccessModifier comment needs to be before annotation if present
* [#4645](https://github.com/pmd/pmd/issues/4645): \[java] CommentDefaultAccessModifier - False Positive with JUnit5's ParameterizedTest
* xml-bestpractices
* [#4592](https://github.com/pmd/pmd/pull/4592): \[xml] Add MissingEncoding rule

View File

@ -52,16 +52,16 @@ public class CommentDefaultAccessModifierRule extends AbstractJavaRulechainRule
"com.google.common.annotations.VisibleForTesting",
"android.support.annotation.VisibleForTesting",
"co.elastic.clients.util.VisibleForTesting",
"org.junit.jupiter.api.Test",
"org.junit.jupiter.api.extension.RegisterExtension",
"org.junit.jupiter.api.ParameterizedTest",
"org.junit.jupiter.api.AfterAll",
"org.junit.jupiter.api.AfterEach",
"org.junit.jupiter.api.BeforeAll",
"org.junit.jupiter.api.BeforeEach",
"org.junit.jupiter.api.RepeatedTest",
"org.junit.jupiter.api.Test",
"org.junit.jupiter.api.TestFactory",
"org.junit.jupiter.api.TestTemplate",
"org.junit.jupiter.api.BeforeEach",
"org.junit.jupiter.api.BeforeAll",
"org.junit.jupiter.api.AfterEach",
"org.junit.jupiter.api.AfterAll",
"org.junit.jupiter.api.extension.RegisterExtension",
"org.junit.jupiter.params.ParameterizedTest",
"org.testng.annotations.Test",
"org.testng.annotations.AfterClass",
"org.testng.annotations.AfterGroups",

View File

@ -454,16 +454,16 @@ public enum MyEnum {
</test-code>
<test-code>
<description>#3859 #4273 [java] CommentDefaultAccessModifier is triggered in JUnit5 method and it was conflicting with rule JUnit5TestShouldBePackagePrivate</description>
<description>#3859 #4273 #4645 [java] CommentDefaultAccessModifier is triggered in JUnit5 method and it was conflicting with rule JUnit5TestShouldBePackagePrivate</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.ParameterizedTest;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.provider.ValueSource;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
class SomeTest {