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

S2699 should support Awaitility test framework

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.4
    • Component/s: Rules
    • Labels:

      Description

      The current implementation of RSPEC-2699 does not support Awaitility framework, used to test asynchronous operations.

      Note that when this ticket is implemented, the whitelist of supported framework in RSPEC-2699 should also be updated (and maybe the list order alphabetically).

      From the documentation of Awaitility, it seems that only a call to .until(condition); marks the end of the definition of an assertion. Therefore, the rule should be extended to only consider a test having an assertions if such call is done, and not only a call to await()

      Example of code asserting nothing:

      await().atMost(TIMEOUT, TimeUnit.SECONDS);
      

      Example of valid assertion using awaitility:

      await().atMost(TIMEOUT, TimeUnit.SECONDS).until(newUserIsAdded());
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael.gumowski Michael Gumowski
                Reporter:
                michael.gumowski Michael Gumowski
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: