Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-3143

S2970 "Assertions should be complete" reports FP with SoftAssertions#assertSoftly

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.14
    • Component/s: Rules
    • Labels:
      None

      Description

      In assertj 3.6.0 , the static method SoftAssertions#assertSoftly has been added to the API. This is an alternative to the JUnitSoftAssertions rule and AutoCloseableSoftAssertions to avoid the need to call assertAll at the end of a test method.
      Rule RSPEC-2970 should therefore not report any issue when assertions without a call to assertAll are found inside inside a lambda being a parameter for SoftAssertions#assertSoftly.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alban.auzeill Alban Auzeill
                Reporter:
                christophe.zurn Christophe Zurn
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: