aboutsummaryrefslogtreecommitdiffstats
path: root/it
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2016-12-14 18:56:53 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-12-15 14:45:04 +0100
commit6e6f004f24142e3739c892bbee9153c26a51d0a1 (patch)
treeb62be7b9d99be931fdf3cb996c63d8b5ea5dc0ab /it
parentf708dfbad7bacac33b18bb5c7c1221565b803fa5 (diff)
downloadsonarqube-6e6f004f24142e3739c892bbee9153c26a51d0a1.tar.gz
sonarqube-6e6f004f24142e3739c892bbee9153c26a51d0a1.zip
SONAR-7294 Replace Ruby WS api/issues/edit_comment
Diffstat (limited to 'it')
-rw-r--r--it/it-tests/src/test/java/it/issue/IssueActionTest.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/it/it-tests/src/test/java/it/issue/IssueActionTest.java b/it/it-tests/src/test/java/it/issue/IssueActionTest.java
index 855d35f18c2..86b70342e85 100644
--- a/it/it-tests/src/test/java/it/issue/IssueActionTest.java
+++ b/it/it-tests/src/test/java/it/issue/IssueActionTest.java
@@ -28,6 +28,7 @@ import org.sonarqube.ws.Issues;
import org.sonarqube.ws.Issues.Issue;
import org.sonarqube.ws.client.issue.AddCommentRequest;
import org.sonarqube.ws.client.issue.AssignRequest;
+import org.sonarqube.ws.client.issue.EditCommentRequest;
import org.sonarqube.ws.client.issue.IssuesService;
import org.sonarqube.ws.client.issue.SearchWsRequest;
import org.sonarqube.ws.client.issue.SetSeverityRequest;
@@ -74,7 +75,6 @@ public class IssueActionTest extends AbstractIssueTest {
@Test
public void add_comment() throws Exception {
Issues.Comment comment = issuesService.addComment(new AddCommentRequest(randomIssue.getKey(), "this is my *comment*")).getIssue().getComments().getComments(0);
-
assertThat(comment.getKey()).isNotNull();
assertThat(comment.getHtmlText()).isEqualTo("this is my <strong>comment</strong>");
assertThat(comment.getLogin()).isEqualTo("admin");
@@ -82,7 +82,6 @@ public class IssueActionTest extends AbstractIssueTest {
// reload issue
Issue reloaded = issueRule.getByKey(randomIssue.getKey());
-
assertThat(reloaded.getComments().getCommentsList()).hasSize(1);
assertThat(reloaded.getComments().getComments(0).getKey()).isEqualTo(comment.getKey());
assertThat(reloaded.getComments().getComments(0).getHtmlText()).isEqualTo("this is my <strong>comment</strong>");
@@ -105,6 +104,18 @@ public class IssueActionTest extends AbstractIssueTest {
assertThat(reloaded.getComments().getCommentsList()).isEmpty();
}
+ @Test
+ public void edit_comment() throws Exception {
+ Issues.Comment comment = issuesService.addComment(new AddCommentRequest(randomIssue.getKey(), "this is my *comment*")).getIssue().getComments().getComments(0);
+ Issues.Comment editedComment = issuesService.editComment(new EditCommentRequest(comment.getKey(), "new *comment*")).getIssue().getComments().getComments(0);
+ assertThat(editedComment.getHtmlText()).isEqualTo("new <strong>comment</strong>");
+
+ // reload issue
+ Issue reloaded = issueRule.getByKey(randomIssue.getKey());
+ assertThat(reloaded.getComments().getCommentsList()).hasSize(1);
+ assertThat(reloaded.getComments().getComments(0).getHtmlText()).isEqualTo("new <strong>comment</strong>");
+ }
+
/**
* SONAR-4352
*/