Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[apex] ApexUnitTestClassShouldHaveAssertsRule: Support new Assert class (Apex v56.0) #4097

Merged
merged 20 commits into from Aug 29, 2022

Conversation

tprouvot
Copy link
Contributor

@tprouvot tprouvot commented Aug 17, 2022

Describe the PR

Apex v56 introduced a new Assert class: https://developer.salesforce.com/docs/atlas.en-us.240.0.apexref.meta/apexref/apex_class_System_Assert.htm#apex_class_System_Assert

Related issues

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)

@SCWells72
Copy link
Contributor

SCWells72 commented Aug 17, 2022

Hi, @tprouvot. The product changes look good. You should also update ApexUnitTestClassShouldHaveAsserts.xml with positive test cases to verify that usages of these new assertion methods result in no reported violations.

@tprouvot
Copy link
Contributor Author

Hi, @tprouvot. The product changes look good. You should also update ApexUnitTestClassShouldHaveAsserts.xml with positive test cases to verify that usages of these new assertion methods result in no reported violations.

Hi @SCWells72,

Thanks for the suggestion !
One of the negative test became ... positive with the new class, thats why I updated it also.

Copy link
Contributor

@SCWells72 SCWells72 left a comment

Choose a reason for hiding this comment

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

Just a couple of small things. Also, I'm not sure if I'll have authority to approve this for merge, but I'll at least try to provide sufficient feedback so that someone who can has less work to do to get to that point.

@tprouvot tprouvot force-pushed the feature/addNewClassForAssertion branch from 2a22c60 to dc03e52 Compare August 18, 2022 15:09
Copy link
Contributor

@SCWells72 SCWells72 left a comment

Choose a reason for hiding this comment

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

I think with the one requested change here it's fine IMO.

@adangel adangel self-requested a review August 24, 2022 10:21
@adangel adangel changed the title [apex] ApexUnitTestClassShouldHaveAssertsRule : Add new assert methods for api 56 [apex] ApexUnitTestClassShouldHaveAssertsRule: Support new Assert class (Apex v56.0) Aug 24, 2022
Copy link
Member

@adangel adangel left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Please have a look at my comments.
I think, we can edit #4096 to cover both rules and improve both rules with this PR.

@adangel
Copy link
Member

adangel commented Aug 24, 2022

@SCWells72 Thanks for the initial review!

@pmd-test
Copy link

1 Message
📖 Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 37 errors and 6 configuration errors.
Full report

Generated by 🚫 Danger

@tprouvot
Copy link
Contributor Author

Thanks for the PR!

Please have a look at my comments. I think, we can edit #4096 to cover both rules and improve both rules with this PR.

Hi @adangel,
Thanks for your suggestions, the PR should contains the additional tests and corrections.

Copy link
Member

@adangel adangel left a comment

Choose a reason for hiding this comment

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

Thanks!

@adangel adangel added this to the 6.49.0 milestone Aug 29, 2022
adangel added a commit that referenced this pull request Aug 29, 2022
adangel added a commit that referenced this pull request Aug 29, 2022
adangel added a commit that referenced this pull request Aug 29, 2022
[apex] ApexUnitTestClassShouldHaveAssertsRule: Support new Assert class (Apex v56.0) #4097
@adangel adangel merged commit 29c4e99 into pmd:master Aug 29, 2022
@tprouvot tprouvot deleted the feature/addNewClassForAssertion branch August 30, 2022 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants