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

Rule S5833: AssertJ methods setting the assertion context should come before an assertion

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.5
    • Component/s: Rules

      Description

      Implements RSPEC-5833

       

      Note that the part with .as(...) could somehow overlap with S2698, we have to make sure that they both cohabit nicely. See SONARJAVA-3389.

      In addition, S2970 will also report incomplete assertion such as:

      assertThat("").as("Description");
      

      We should not report an issue if no assertion is made before, to avoid overlap.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                quentin.jaquier Quentin Jaquier
                Reporter:
                quentin.jaquier Quentin Jaquier
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: