I am using Sonarqube version 9.9.0 and it’s deployed using Docker. I am trying to increase the coverage. The following block gives error of Not covered by tests and I have already written test cases from every aspect which cover every validation error. However, the error after sonar scan still persist. Please refer to the screenshot below.
Please guide seniors, your cooperation in this regard would be highly cherished. I would really admire if someone would connect with me on Anydesk/Teamviewer.
Use I followed the documentation the issue resolved in a middleware. However, it’s not remove the error on other controllers. I have already created test cases which cover every case of method but it’s still not working. I would be glad if you will connect with me over Anydesk/Teamviewer as it is a big blocker.
This is a Community Forum. If you need to continue troubleshooting, I suggest attaching more screenshots, logs, etc.
It’s not clear to me what fixed one issue that isn’t resolving it in other cases.
And, it’s important to remember that SonarQube relies entirely on the coverage reports it is being passed. If those coverage reports don’t represent the files/code as being covered, neither will SonarQube. And you’ll have to troubleshoot that with the coverage tool.
Ok Leave that, please just tell me how should I write the unit test against the following code which will remove the red line error as shown in screenshot.