use of org.sonarqube.ws.Hotspots in project sonarqube by SonarSource.
the class SearchActionTest method insertRandomNumberOfHotspotsOfAllSupportedStatusesAndResolutions.
private Stream<IssueDto> insertRandomNumberOfHotspotsOfAllSupportedStatusesAndResolutions(ComponentDto project, ComponentDto file) {
RuleDefinitionDto rule = newRule(SECURITY_HOTSPOT);
List<IssueDto> hotspots = Arrays.stream(validStatusesAndResolutions()).flatMap(objects -> {
String status = (String) objects[0];
String resolution = (String) objects[1];
return IntStream.range(0, 1 + RANDOM.nextInt(15)).mapToObj(i -> newIssue(rule, project, file).setKee("hotspot_" + status + "_" + resolution + "_" + i).setType(SECURITY_HOTSPOT).setStatus(status).setResolution(resolution));
}).collect(toList());
Collections.shuffle(hotspots);
hotspots.forEach(t -> dbTester.issues().insertHotspot(t));
return hotspots.stream();
}
Aggregations