diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-11-03 22:35:21 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-11-03 22:35:21 +0100 |
commit | 4d5a0b1c1cd8e787cedffe2cc8d1f4772b74c2b0 (patch) | |
tree | de343cafa0a9d91b30208c6324bb9d84b48e6100 /sonar-ws-client | |
parent | 2eb5e77ee6ff9f74f70a294e19c3ad23411367d1 (diff) | |
download | sonarqube-4d5a0b1c1cd8e787cedffe2cc8d1f4772b74c2b0.tar.gz sonarqube-4d5a0b1c1cd8e787cedffe2cc8d1f4772b74c2b0.zip |
SONAR-4834 Add technical debt in issues changelog
Diffstat (limited to 'sonar-ws-client')
2 files changed, 45 insertions, 0 deletions
diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java index d7c5e22a07b..87f86d26c4e 100644 --- a/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java +++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java @@ -20,6 +20,7 @@ package org.sonar.wsclient.issue.internal; import org.apache.commons.io.IOUtils; +import org.junit.Ignore; import org.junit.Test; import org.sonar.wsclient.base.Paging; import org.sonar.wsclient.component.Component; @@ -241,6 +242,25 @@ public class IssueJsonParserTest { } @Test + @Ignore + public void should_parse_changelog_with_technical_debt() throws Exception { + String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog-with-technical-debt.json")); + List<IssueChange> changes = new IssueJsonParser().parseChangelog(json); + + assertThat(changes).hasSize(1); + IssueChange change = changes.get(0); + assertThat(change.user()).isEqualTo("julien"); + assertThat(change.createdAt().getTime()).isEqualTo(1383202235000l); + assertThat(change.updatedAt().getTime()).isEqualTo(1383202235000l); + + assertThat(change.diffs()).hasSize(1); + IssueChangeDiff diffChange1 = change.diffs().get(0); + assertThat(diffChange1.key()).isEqualTo("technicalDebt"); + assertThat(diffChange1.newValue()).isEqualTo("1.0"); + assertThat(diffChange1.oldValue()).isNull(); + } + + @Test public void should_parse_bulk_change() throws Exception { String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/bulk-change.json")); BulkChange bulkChange = new IssueJsonParser().parseBulkChange(json); diff --git a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog-with-technical-debt.json b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog-with-technical-debt.json new file mode 100644 index 00000000000..cb1acd79fbe --- /dev/null +++ b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/changelog-with-technical-debt.json @@ -0,0 +1,25 @@ +{ + "changelog": [ + { + "user": "julien", + "createdAt": "2013-10-31T07:50:35+0100", + "updatedAt": "2013-10-31T07:50:35+0100", + "diffs": [ + { + "key": "technicalDebt", + "oldValue": { + "days": 3, + "hours": 0, + "minutes": 10 + }, + "newValue": { + "days": 2, + "hours": 1, + "minutes": 0 + } + } + ] + } + ] +} + |