Package com.atlassian.jira.rest.client.api.domain

Examples of com.atlassian.jira.rest.client.api.domain.Comment


    final Worklog worklog3 = Iterables.get(worklogs, 3);
    assertEquals(StringUtils.EMPTY, worklog3.getComment());

    // comments
    assertEquals(4, Iterables.size(issue.getComments()));
    final Comment comment = issue.getComments().iterator().next();
    assertEquals(Visibility.Type.ROLE, comment.getVisibility().getType());
    assertEquals(TestConstants.USER_ADMIN_BASIC, comment.getAuthor());
    assertEquals(TestConstants.USER_ADMIN_BASIC, comment.getUpdateAuthor());

    // components
    final Iterable<String> componentsNames = EntityHelper.toNamesList(issue.getComponents());
    assertThat(componentsNames, containsInAnyOrder("Component A", "Component B"));
  }
View Full Code Here


  @Test
  public void testParseIssueWithAnonymousComment() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-anonymous-comment.json");
    assertEquals(1, Iterables.size(issue.getComments()));
    final Comment comment = issue.getComments().iterator().next();
    assertEquals("Comment from anonymous user", comment.getBody());
    assertNull(comment.getAuthor());

  }
View Full Code Here

    });
  }

  @Test
  public void testTransitionWithNoRoleOrGroup() {
    Comment comment = Comment.valueOf("My text which I am just adding " + new DateTime());
    testTransitionImpl(comment);
  }
View Full Code Here

    testTransitionImpl(comment);
  }

  @Test
  public void testTransitionWithRoleLevel() {
    Comment comment = Comment.createWithRoleLevel("My text which I am just adding " + new DateTime(), "Users");
    testTransitionImpl(comment);
  }
View Full Code Here

    testTransitionImpl(comment);
  }

  @Test
  public void testTransitionWithGroupLevel() {
    Comment comment = Comment.createWithGroupLevel("My text which I am just adding " + new DateTime(), "jira-users");
    testTransitionImpl(comment);
  }
View Full Code Here

    testTransitionImpl(comment);
  }

  @Test
  public void testTransitionWithInvalidRole() {
    final Comment comment = Comment.createWithRoleLevel("My text which I am just adding " + new DateTime(), "some-fake-role");
    if (IntegrationTestUtil.TESTING_JIRA_5_OR_NEWER) {
      assertInvalidCommentInput(comment, "Invalid role level specified.");
    } else {
      assertInvalidCommentInput(comment, "Invalid role [some-fake-role]");
    }
View Full Code Here

    }
  }

  @Test
  public void testTransitionWithInvalidGroup() {
    final Comment comment = Comment.createWithGroupLevel(
        "My text which I am just adding " + new DateTime(), "some-fake-group");
    assertInvalidCommentInput(comment, "Group: some-fake-group does not exist.");
  }
View Full Code Here

    Transition transitionFound = TestUtil.getTransitionByName(transitions, "Estimate");
    DateTime now = new DateTime();
    client.getIssueClient().transition(issue, new TransitionInput(transitionFound.getId(), comment)).claim();

    final Issue changedIssue = client.getIssueClient().getIssue("TST-1").claim();
    final Comment lastComment = Iterables.getLast(changedIssue.getComments());
    assertEquals(comment.getBody(), lastComment.getBody());
    assertEquals(IntegrationTestUtil.USER_ADMIN, lastComment.getAuthor());
    assertEquals(IntegrationTestUtil.USER_ADMIN, lastComment.getUpdateAuthor());
    assertEquals(lastComment.getCreationDate(), lastComment.getUpdateDate());
    assertTrue(lastComment.getCreationDate().isAfter(now) || lastComment.getCreationDate().isEqual(now));
    assertEquals(comment.getVisibility(), lastComment.getVisibility());
  }
View Full Code Here

    assertEquals(IssueLinkType.Direction.OUTBOUND, addedLink.getIssueLinkType().getDirection());

    final int expectedNumComments = commentInput != null ? origNumComments + 1 : origNumComments;
    assertEquals(expectedNumComments, Iterables.size(linkedIssue.getComments()));
    if (commentInput != null) {
      final Comment comment = linkedIssue.getComments().iterator().next();
      assertEquals(commentInput.getBody(), comment.getBody());
      assertEquals(IntegrationTestUtil.USER_ADMIN, comment.getAuthor());
      assertEquals(commentInput.getVisibility(), comment.getVisibility());
    } else {
      assertFalse(linkedIssue.getComments().iterator().hasNext());
    }

View Full Code Here

    assertEquals(IntegrationTestUtil.USER_ADMIN, client.getIssueClient().getIssue("TST-5").claim().getAssignee());
    navigation.logout();
    navigation.issue().addComment("ANNON-1", "my nice comment");
    final Issue issue = client.getIssueClient().getIssue("ANNON-1").claim();
    assertEquals(1, Iterables.size(issue.getComments()));
    final Comment comment = issue.getComments().iterator().next();
    assertEquals("my nice comment", comment.getBody());
    if (isJira5xOrNewer()) {
      assertNotNull(comment.getId());
    } else {
      assertNull(comment.getId());
    }
    assertNull(comment.getAuthor());
    assertNull(comment.getUpdateAuthor());

  }
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.api.domain.Comment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.