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


I’m using MockWebServiceClient provided by springframework’s artifact spring-ws-test to run tests on SOAP webservices.
It provides its own class to make assertions like this:


Sonar states that I need to “Add at least one assertion to this test case” so I get several CodeSmells where I should not.
Can it be changed in future updates of the “Sonar Way” quality profile so that it sees it as a normal assertion?

I have been using, MockMvc for REST testing in other projects, which provides kind of the same assertions method, and Sonar handles those normally.


1 Like

Hello @Alexandre_MEYER,

Thanks for the report. This is indeed a false-positive. And here is the ticket to track it:


Thank you Margarita.

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