use of org.sonarqube.ws.Issues.ChangelogWsResponse in project sonarqube by SonarSource.
the class ChangelogActionTest method replace_technical_debt_key_by_effort.
@Test
public void replace_technical_debt_key_by_effort() throws Exception {
UserDto user = db.users().insertUser();
IssueDto issueDto = db.issues().insertIssue(newIssue());
userSession.logIn("john").addProjectUuidPermissions(USER, issueDto.getProjectUuid());
db.issues().insertFieldDiffs(issueDto, new FieldDiffs().setUserLogin(user.getLogin()).setDiff("technicalDebt", "10", "20"));
ChangelogWsResponse result = call(issueDto.getKey());
assertThat(result.getChangelogList()).hasSize(1);
assertThat(result.getChangelogList().get(0).getDiffsList()).extracting(Diff::getKey, Diff::getOldValue, Diff::getNewValue).containsOnly(tuple("effort", "10", "20"));
}
use of org.sonarqube.ws.Issues.ChangelogWsResponse in project sonarqube by SonarSource.
the class ChangelogActionTest method return_changelog.
@Test
public void return_changelog() throws Exception {
UserDto user = db.users().insertUser();
IssueDto issueDto = db.issues().insertIssue(newIssue());
userSession.logIn("john").addProjectUuidPermissions(USER, issueDto.getProjectUuid());
db.issues().insertFieldDiffs(issueDto, new FieldDiffs().setUserLogin(user.getLogin()).setDiff("severity", "MAJOR", "BLOCKER"));
ChangelogWsResponse result = call(issueDto.getKey());
assertThat(result.getChangelogList()).hasSize(1);
assertThat(result.getChangelogList().get(0).getUser()).isNotNull().isEqualTo(user.getLogin());
assertThat(result.getChangelogList().get(0).getUserName()).isNotNull().isEqualTo(user.getName());
assertThat(result.getChangelogList().get(0).getEmail()).isNotNull().isEqualTo(user.getEmail());
assertThat(result.getChangelogList().get(0).getCreationDate()).isNotEmpty();
assertThat(result.getChangelogList().get(0).getDiffsList()).extracting(Diff::getKey, Diff::getOldValue, Diff::getNewValue).containsOnly(tuple("severity", "MAJOR", "BLOCKER"));
}
use of org.sonarqube.ws.Issues.ChangelogWsResponse in project sonarqube by SonarSource.
the class ChangelogActionTest method return_empty_changelog_when_no_changes_on_issue.
@Test
public void return_empty_changelog_when_no_changes_on_issue() {
IssueDto issueDto = db.issues().insertIssue(newIssue());
userSession.logIn("john").addProjectUuidPermissions(USER, issueDto.getProjectUuid());
ChangelogWsResponse result = call(issueDto.getKey());
assertThat(result.getChangelogList()).isEmpty();
}
Aggregations