I’m experiencing a false positive with rule S2699. The rule description explicitly mentions support for Spring’s org.springframework.test.web.servlet.ResultActions.andExpect(), so I expect the following test to be compliant.
However this is not the case, I do get an error for this test.
Hi @Alexandre_Gigleux,
i have the same issue with
spring-test version 5.2.4.RELEASE.
SonarQube Version: Community Edition Version 7.9.2 (build 30863)
Java Code Quality and Security plugin 6.3 (build 21585) installed
Edit: updating SonarQube (or the java analyzer version), also solved this problem for some users.
Hello,
Before starting, I just want to warn that my post targets recent versions of the plugin (>=6.0). It might or might not be related to the initial problem raised by this post.
Such unexpected behavior is typically due to missing bytecode of dependencies.
I discussed a similar issue in this post, it does not target the same rule nor the same method, but I believe the solutions proposed there could be relevant to you.
Did you have a look at the post that I linked in my previous message?
If yes, can you briefly describe what you tried? Do you see anything special in the logs of the analysis?
In addition, it would be helpful to know the version of the scanner, Sonarqube, and optionally the java analyzer version if you updated it at one point.