Search in sources :

Example 1 with EditCommentRequest

use of org.sonarqube.ws.client.issue.EditCommentRequest in project sonarqube by SonarSource.

the class IssueActionTest method edit_comment.

@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>");
}
Also used : AddCommentRequest(org.sonarqube.ws.client.issue.AddCommentRequest) Issue(org.sonarqube.ws.Issues.Issue) Issues(org.sonarqube.ws.Issues) EditCommentRequest(org.sonarqube.ws.client.issue.EditCommentRequest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Issues (org.sonarqube.ws.Issues)1 Issue (org.sonarqube.ws.Issues.Issue)1 AddCommentRequest (org.sonarqube.ws.client.issue.AddCommentRequest)1 EditCommentRequest (org.sonarqube.ws.client.issue.EditCommentRequest)1