diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2016-12-12 16:55:09 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2016-12-13 16:15:07 +0100 |
commit | 90f6238d3434a2dcfb1ac85f7a253c0cd41ede86 (patch) | |
tree | 1c6acd0a06f2101a061868ae84bc04ed9aa55326 /it | |
parent | 1593d587b770c84b919d9c019031cad87ba70a39 (diff) | |
download | sonarqube-90f6238d3434a2dcfb1ac85f7a253c0cd41ede86.tar.gz sonarqube-90f6238d3434a2dcfb1ac85f7a253c0cd41ede86.zip |
SONAR-8531 api/issues/changelog should return raw value of effort
Diffstat (limited to 'it')
-rw-r--r-- | it/it-tests/src/test/java/it/qualityModel/TechnicalDebtInIssueChangelogTest.java | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtInIssueChangelogTest.java b/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtInIssueChangelogTest.java index 50c0eef7ade..f64abe6a5ce 100644 --- a/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtInIssueChangelogTest.java +++ b/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtInIssueChangelogTest.java @@ -79,39 +79,8 @@ public class TechnicalDebtInIssueChangelogTest { assertThat(change.diffs()).hasSize(1); IssueChangeDiff changeDiff = change.diffs().get(0); assertThat(changeDiff.key()).isEqualTo("effort"); - assertThat(changeDiff.oldValue()).isEqualTo("10min"); - assertThat(changeDiff.newValue()).isEqualTo("1h40min"); - } - - @Test - public void use_hours_in_day_property_to_display_debt_in_issue_changelog() throws Exception { - orchestrator.getServer().restoreProfile(FileLocation.ofClasspath("/qualityModel/one-issue-per-file.xml")); - orchestrator.getServer().provisionProject("sample", "sample"); - orchestrator.getServer().associateProjectToQualityProfile("sample", "xoo", "one-issue-per-file"); - - // Execute a first analysis to have a past snapshot - orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample"))); - - // One day -> 10 hours - debtConfiguration.updateHoursInDay(10); - - orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample")) - // As OneIssuePerFile has a debt of 10 minutes, we multiply it by 72 to have 1 day and 2 hours of technical debtn - .setProperties("sonar.oneIssuePerFile.effortToFix", "72") - ); - - IssueClient issueClient = orchestrator.getServer().wsClient().issueClient(); - Issue issue = issueClient.find(IssueQuery.create()).list().get(0); - List<IssueChange> changes = issueClient.changes(issue.key()); - - assertThat(changes).hasSize(1); - IssueChange change = changes.get(0); - - assertThat(change.diffs()).hasSize(1); - IssueChangeDiff changeDiff = change.diffs().get(0); - assertThat(changeDiff.key()).isEqualTo("effort"); - assertThat(changeDiff.oldValue()).isEqualTo("10min"); - assertThat(changeDiff.newValue()).isEqualTo("1d2h"); + assertThat(changeDiff.oldValue()).isEqualTo("10"); + assertThat(changeDiff.newValue()).isEqualTo("100"); } } |