GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [apex] Remove class name suffix "Test" as indicator of test classes by dschach · Pull Request #6563 · pmd/pmd

Conversation

@dschach

@dschach dschach commented Apr 1, 2026 •
edited by adangel
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

The only indicator of an Apex test class should be the isTest() property

Describe the PR

The existing code was indicating that any class with @IsTest annotation OR ending in Test was a test class.

The only way to identify an Apex test class should be the annotation check.

Related issues

  • Fix [apex] Apex files ending in "Test" are skipped with a number of rules #5386
  • Fix [apex] ApexCRUDViolation not reported even if SOQL doesn't have permissions check on it #5385

Ready?

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dschach
fix: remove class name as indicator of test class
e35a55e
The only indicator of an Apex test class should be the isTest() property
@codacy-production

codacy-production Bot commented Apr 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dschach added 3 commits March 31, 2026 17:04
@dschach
Add return false for non-test method check
f9b6f77
@dschach
fix regression failure on CRUDViolation rule test
7f83552
@dschach
update in-code documentation to indicate
d915e40
@dschach
dschach marked this pull request as ready for review April 1, 2026 17:35
@pmd-actions-helper

pmd-actions-helper Bot commented Apr 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Documentation Preview

Compared to main:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.

Regression Tester Report

(comment created at 2026-04-07 17:32:40+00:00 for 415f5cf)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dschach

dschach commented Apr 1, 2026

Copy link
Copy Markdown
Contributor Author

@adangel Updated Apex check for test class to look only at IsTest annotation in the helper class.

Please see the referenced issues for context.

I had to update another test because it relied on the class name filter; I updated it to use the annotation, as that is an Apex requirement anyway.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

adangel
adangel reviewed Apr 7, 2026
View reviewed changes
Comment thread pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/internal/Helper.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@adangel
Apply suggestion from @adangel
415f5cf
@adangel adangel added this to the 7.24.0 milestone Apr 7, 2026
@adangel adangel changed the title [apex] Remove class name as indicator of test class in helper Java [apex] Remove class name suffix "Test" as indicator of test classes Apr 7, 2026
adangel
adangel approved these changes Apr 7, 2026
View reviewed changes

@adangel adangel left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dschach reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
adangel added a commit that referenced this pull request Apr 7, 2026
@adangel
[doc] Update release notes (#6563, #5386, #5385)
397a84e
adangel added a commit that referenced this pull request Apr 7, 2026
@adangel
[apex] Remove class name suffix "Test" as indicator of test classes (#…
f1b019b
…6563)
@adangel
adangel merged commit 415f5cf into pmd:main Apr 7, 2026
9 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adangel adangel adangel approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

7.24.0

Development

Successfully merging this pull request may close these issues.

[apex] Apex files ending in "Test" are skipped with a number of rules [apex] ApexCRUDViolation not reported even if SOQL doesn't have permissions check on it

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@dschach @adangel
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.