FP: S2970 with AssertJ / SoftAssertions / Field Injection

The following code produces a False Positive.

The problem is similar to [SONARJAVA-3324] FP in S2970 when using JUnit 5 Soft assertions extension. - SonarSource with one difference: in SONARJAVA-3324 the SoftAssertions instance is passed as parameter to the test method, in the following example it is injected into the test class.

class JUnit5SoftAssertionsExample {
  private org.assertj.core.api.SoftAssertions softly;

  void junit5_soft_assertions_example() {
    // No need to call softly.assertAll(), this is automatically done by the SoftAssertionsExtension

Hey there.

What products are you using (SonarQube, SonarCloud, SonarLint) and if relevant: what versions?

Hey Colin,

I first noticed it on SonarQube Developer Edition 9.3 (Build 51899).

I can reproduce it on SonarQube Community Edition Version 9.4 (Build 54424).

Hey Colin,

any updates on this?