The goal of this ticket is to provide a default implementation of the classes involved in the creation of issues in the sonar-testing-harness module, suited for unit tests and assertions.
As SonarQube 4.4 is going to become the next LTS version, the upgrade to its API will soon be possible. This is an excellent opportunity to provide a short-term fix, without having to depend on a full API redesign.
The new issue API relies on complex chains of method calls to be able to create a single issue.
Lots of different classes are involved in the process:
Let's take the StyleCop plugin sensor as an example, which has 165 lines:
The unit test class has 190 lines, and must mock the whole chain of calls:
Due to these testing difficulties, there currently is some resistance in migrating from Violation to Issue