use of org.sonarqube.ws.client.issue.SetSeverityRequest in project sonarqube by SonarSource.
the class IssueActionTest method change_severity.
/**
* SONAR-4352
*/
@Test
public void change_severity() {
String componentKey = "sample";
// there are no blocker issues
assertThat(searchIssuesBySeverities(componentKey, "BLOCKER")).isEmpty();
// increase the severity of an issue
issuesService.setSeverity(new SetSeverityRequest(randomIssue.getKey(), "BLOCKER"));
assertThat(searchIssuesBySeverities(componentKey, "BLOCKER")).hasSize(1);
projectAnalysis.run();
Issue reloaded = issueRule.getByKey(randomIssue.getKey());
assertThat(reloaded.getSeverity()).isEqualTo(BLOCKER);
assertThat(reloaded.getStatus()).isEqualTo("OPEN");
assertThat(reloaded.hasResolution()).isFalse();
assertThat(reloaded.getCreationDate()).isEqualTo(randomIssue.getCreationDate());
assertThat(toDatetime(reloaded.getCreationDate())).isBefore(toDatetime(reloaded.getUpdateDate()));
}
Aggregations