S2699 does not recognize some assertJ assertions

java:S2699 “Add at least one assertion to this test case” is reported for

  @Test
  void falsePositive() {
    org.assertj.core.api.BDDAssertions.thenRuntimeException()
        .isThrownBy(() -> System.out.println("hmm"));
  }

by SonarSource 7.1.1.54565 with methods added in AssertJ 3.23.0

Hey @lbenedetto ,

Thanks for the feedback, it seems that we are indeed lacking behind AssertJ release with our java analyzer, and we do not cover some of their recent assertions.

I created the following ticket to handle it: SONARJAVA-4343

Cheers,
Michael

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.