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

S2698 FP on junit5 assertDoesNotThrow

    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

      Method assertDoesNotThrow (Junit 5.2.0) is not correctly recognized by rule S2698.

       org.junit.jupiter.api.Assertions.assertDoesNotThrow(MyApplication::new, "My message"); // raise false positive as this method is not identified as a method which has only one parameter (besides optional message). 

       
      Additionally, test cases for the following junit5 methods should be added, as they are currently missing

      • assertDoesNotThrow
      • assertIterableEquals
      • assertTimeout
      • assertTimeoutPreemptively

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael.gumowski Michael Gumowski
                Reporter:
                nicolas.peru Nicolas Peru
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: