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


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 = ... 


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?


Hey there.

What version of SonarQube are you using?


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

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)