use of org.sonarqube.ws.Issues.ChangelogWsResponse.Changelog in project sonarqube by SonarSource.
the class IssueChangelogTest method update_changelog_when_assigning_issue_by_user.
@Test
public void update_changelog_when_assigning_issue_by_user() throws Exception {
runProjectAnalysis(ORCHESTRATOR, "shared/xoo-sample");
Issue issue = searchRandomIssue();
assertIssueHasNoChange(issue.key());
adminIssueClient().assign(issue.key(), "admin");
List<Changelog> changes = changelog(issue.key()).getChangelogList();
assertThat(changes).hasSize(1);
Changelog change = changes.get(0);
assertThat(change.getUser()).isEqualTo("admin");
assertThat(change.getCreationDate()).isNotNull();
assertThat(change.getDiffsList()).extracting(Changelog.Diff::getKey, Changelog.Diff::hasOldValue, Changelog.Diff::getNewValue).containsOnly(tuple("assignee", false, "Administrator"));
}
use of org.sonarqube.ws.Issues.ChangelogWsResponse.Changelog in project sonarqube by SonarSource.
the class IssueChangelogTest method display_file_name_in_changelog_during_file_move.
@Test
public void display_file_name_in_changelog_during_file_move() {
// version 1
runProjectAnalysis(ORCHESTRATOR, "issue/xoo-tracking-v1");
// version 2
runProjectAnalysis(ORCHESTRATOR, "issue/xoo-tracking-v3");
Issue issue = searchRandomIssue();
List<Changelog> changes = changelog(issue.key()).getChangelogList();
assertThat(changes).hasSize(1);
Changelog change = changes.get(0);
assertThat(change.hasUser()).isFalse();
assertThat(change.getCreationDate()).isNotNull();
assertThat(change.getDiffsList()).extracting(Changelog.Diff::getKey, Changelog.Diff::getOldValue, Changelog.Diff::getNewValue).containsOnly(tuple("file", "src/main/xoo/sample/Sample.xoo", "src/main/xoo/sample/Sample2.xoo"));
}
use of org.sonarqube.ws.Issues.ChangelogWsResponse.Changelog in project sonarqube by SonarSource.
the class IssueChangelogTest method update_changelog_when_reopening_unresolved_issue_by_scan.
@Test
public void update_changelog_when_reopening_unresolved_issue_by_scan() throws Exception {
runProjectAnalysis(ORCHESTRATOR, "shared/xoo-sample");
Issue issue = searchRandomIssue();
assertIssueHasNoChange(issue.key());
// re analyse the project after resolving an issue in order to reopen it
adminIssueClient().doTransition(issue.key(), "resolve");
runProjectAnalysis(ORCHESTRATOR, "shared/xoo-sample");
List<Changelog> changes = changelog(issue.key()).getChangelogList();
assertThat(changes).hasSize(2);
// Change done by the user (first change is be the oldest one)
Changelog change1 = changes.get(0);
assertThat(change1.getUser()).isEqualTo("admin");
assertThat(change1.getCreationDate()).isNotNull();
assertThat(change1.getDiffsList()).extracting(Changelog.Diff::getKey, Changelog.Diff::getOldValue, Changelog.Diff::getNewValue).containsOnly(tuple("resolution", "", "FIXED"), tuple("status", "OPEN", "RESOLVED"));
// Change done by scan
Changelog change2 = changes.get(1);
assertThat(change2.hasUser()).isFalse();
assertThat(change2.getCreationDate()).isNotNull();
assertThat(change2.getDiffsList()).extracting(Changelog.Diff::getKey, Changelog.Diff::getOldValue, Changelog.Diff::getNewValue).containsOnly(tuple("resolution", "", ""), tuple("status", "RESOLVED", "REOPENED"));
}