@Test
public void security_hotspot_type_included_when_explicitly_selected() {
ComponentDto project = db.components().insertPublicProject();
ComponentDto file = db.components().insertComponent(newFileDto(project));
RuleDefinitionDto rule = newRule().getDefinition();
db.issues().insert(rule, project, file, i -> i.setType(RuleType.BUG));
db.issues().insert(rule, project, file, i -> i.setType(RuleType.VULNERABILITY));
db.issues().insert(rule, project, file, i -> i.setType(RuleType.CODE_SMELL));
db.issues().insert(rule, project, file, i -> i.setType(RuleType.SECURITY_HOTSPOT));
indexPermissions();
indexIssues();
assertThat(ws.newRequest()
.setParam("types", RuleType.SECURITY_HOTSPOT.toString())
.executeProtobuf(SearchWsResponse.class).getIssuesList())
.extracting(Issue::getType)
.containsExactlyInAnyOrder(Common.RuleType.SECURITY_HOTSPOT);
assertThat(ws.newRequest()
.setParam("types", String.format("%s,%s", RuleType.BUG, RuleType.SECURITY_HOTSPOT))
.executeProtobuf(SearchWsResponse.class).getIssuesList())
.extracting(Issue::getType)
.containsExactlyInAnyOrder(Common.RuleType.BUG, Common.RuleType.SECURITY_HOTSPOT);
}