Sonar reports Add at least one assertion to this test case. with HttpGraphQlTester

Hi,

I’m using the Spring for GraphQL project which provides its own class to make assertions in unit tests.
It seems sonar does not detect the assertions and report a bug:

Add at least one assertion to this test case.

  • JaCoCo version: 0.8.8
  • Operating system: Ubuntu
  • Tool integration: Maven
  • Steps to reproduce:

Write a unit test with JUnit making an assertion with the HttpGraphQlTester from Spring for Graphql

HttpGraphQlTester tester = ... 

tester.documentName("search")
    .execute()
    .path("data.search.total")
    .entity(Integer.class)
    .equals(2);

Since the HttpGraphQlTester makes an assertion, no bug should be reported, but sonar does.

Is there any way to avoid such report or should it be fixed directly in sonar source code?

Thanks

Hey there.

What version of SonarQube are you using?

Hello,

I use org.codehaus.mojo:sonar-maven-plugin:3.9.1.2184

Hey there.

The more important thing will be the version of the SonarQube server you’ve installed (you should fine this information in the footer of your instance)