Skip to content

[java] Fix #6704: rename rules and properties with JUnit5 in the name#6707

Merged
UncleOwen merged 8 commits into
pmd:mainfrom
UncleOwen:issue-6704-Rename-rules-and-properties-with-JUnit5-in-the-name
May 24, 2026
Merged

[java] Fix #6704: rename rules and properties with JUnit5 in the name#6707
UncleOwen merged 8 commits into
pmd:mainfrom
UncleOwen:issue-6704-Rename-rules-and-properties-with-JUnit5-in-the-name

Conversation

@UncleOwen

Copy link
Copy Markdown
Member

Describe the PR

This PR renames...

  • JUnit5TestShouldBePackagePrivate to JUnitJupiterTestShouldBePackagePrivate
  • JUnit5TestNoPrivateModifier to JUnitJupiterTestNoPrivateModifier
  • the property junit5TestPattern of MethodNamingConventions to junitJupiterTestPattern

Related issues

Ready?

  • [n/a] Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • [n/a] Added (in-code) documentation (if needed)

@UncleOwen UncleOwen marked this pull request as draft May 22, 2026 20:57
@zbynek

zbynek commented May 22, 2026

Copy link
Copy Markdown
Contributor

(The rule name is also mentione in release notes #5477)

@UncleOwen

Copy link
Copy Markdown
Member Author

I know. I'll fix it tomorrow. Too late to think.

UncleOwen added 3 commits May 23, 2026 10:25
…difierRule

No need to keep an JUnit5TestNoPrivateModifierRule.java around
- there was never a PMD release with a
JUnit5TestNoPrivateModifierRule.java
…BePackagePrivateRule

No need to keep an JUnit5TestShouldBePackagePrivate.java around
- there was never a PMD release with a
JUnit5TestShouldBePackagePrivate.java
@UncleOwen UncleOwen force-pushed the issue-6704-Rename-rules-and-properties-with-JUnit5-in-the-name branch from 4e8aab0 to a41b72c Compare May 23, 2026 08:30
@UncleOwen UncleOwen force-pushed the issue-6704-Rename-rules-and-properties-with-JUnit5-in-the-name branch from a41b72c to 52ff997 Compare May 23, 2026 08:43
@pmd-actions-helper

pmd-actions-helper Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

Documentation Preview

Compared to main:
This changeset changes 383 violations,
introduces 16784 new violations, 0 new errors and 0 new configuration errors,
removes 16784 violations, 0 errors and 0 configuration errors.
There are 0 changed duplications, 0 new duplications and 0 removed duplications.
There are 0 changed CPD errors, 0 new CPD errors and 0 removed CPD errors.

Regression Tester Report

(comment created at 2026-05-23 12:59:07+00:00 for 667a763)

@UncleOwen UncleOwen marked this pull request as ready for review May 23, 2026 09:31
@UncleOwen

Copy link
Copy Markdown
Member Author

For both rules there was no FooRule.java in 7.24.0 (one rule didn't exist at all, the other was an XPath rule). That's why there are no deprecated subclasses and no "API Changes" section in the release notes. Apart from that, I think I followed all the steps mentioned in the ticket.

@lukasgraef

Copy link
Copy Markdown
Contributor

Should we also rename all of the isJunit5* methods in TestFrameworkUtil to keep the naming consistent across the codebase?

@UncleOwen

Copy link
Copy Markdown
Member Author

Not right now. At a minimum I'd like #6689 to be merged before I touch TestFrameworkUtil again.

Comment thread pmd-java/src/main/resources/category/java/bestpractices.xml Outdated
Comment thread pmd-java/src/main/resources/category/java/errorprone.xml Outdated
@UncleOwen UncleOwen merged commit 0251a55 into pmd:main May 24, 2026
9 checks passed
@UncleOwen UncleOwen added this to the 7.25.0 milestone May 24, 2026
@UncleOwen UncleOwen deleted the issue-6704-Rename-rules-and-properties-with-JUnit5-in-the-name branch May 24, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[java] Rename rules and properties with JUnit5 in the name

3 participants