Skip to content

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

Merged
adangel merged 20 commits into
pmd:masterfrom
tprouvot:feature/addNewClassForAssertion
Aug 29, 2022
Merged

[apex] ApexUnitTestClassShouldHaveAssertsRule: Support new Assert class (Apex v56.0)#4097
adangel merged 20 commits into
pmd:masterfrom
tprouvot:feature/addNewClassForAssertion

Conversation

@tprouvot

@tprouvot tprouvot commented Aug 17, 2022

Copy link
Copy Markdown
Contributor

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

SCWells72 commented Aug 17, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

@SCWells72 SCWells72 left a comment

Copy link
Copy Markdown
Contributor

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

@SCWells72 SCWells72 left a comment

Copy link
Copy Markdown
Contributor

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

@adangel adangel left a comment

Copy link
Copy Markdown
Member

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

adangel commented Aug 24, 2022

Copy link
Copy Markdown
Member

@SCWells72 Thanks for the initial review!

@ghost

ghost commented Aug 24, 2022

Copy link
Copy Markdown
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
Copy Markdown
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.

@adangel adangel left a comment

Copy link
Copy Markdown
Member

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

Development

Successfully merging this pull request may close these issues.

[apex] ApexAssertionsShouldIncludeMessage and ApexUnitTestClassShouldHaveAsserts: support new Assert class (introduced with Apex v56.0)

3 participants