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

Examples of com.atlassian.jira.rest.client.domain.Issue


    // try to get as anonymous user
    setAnonymousMode();

    final IssueRestClient issueClient = client.getIssueClient();
    final Issue issue = issueClient.getIssue(issueKey, pm);

    // test if we can see added comment
    assertFalse(hasComment(issue.getComments(), addedComment.getId()));
  }
View Full Code Here


    // try to get as anonymous user
    setAnonymousMode();

    final IssueRestClient issueClient = client.getIssueClient();
    final Issue issue = issueClient.getIssue(issueKey, pm);

    // test if we can see added comment
    assertFalse(hasComment(issue.getComments(), addedComment.getId()));
  }
View Full Code Here

    }).iterator().hasNext();
  }

  private Comment testAddCommentToIssueImpl(final String issueKey, final Comment comment) {
    final IssueRestClient issueClient = client.getIssueClient();
    final Issue issue = issueClient.getIssue(issueKey, pm);
    final List<Comment> initialComments = Lists.newArrayList(issue.getComments());

    issueClient.addComment(pm, issue.getCommentsUri(), comment);

    final Issue issueWithComments = issueClient.getIssue(issueKey, pm);
    final List<Comment> newComments = Lists.newArrayList(issueWithComments.getComments());
    newComments.removeAll(initialComments);
    assertEquals(1, Iterables.size(newComments));
    Comment addedComment = newComments.get(0);
    assertEquals(comment.getBody(), addedComment.getBody());
    assertEquals(comment.getVisibility(), addedComment.getVisibility());
View Full Code Here

  }

  @Test
  public void testParseIssueJira50Representation() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-5.0-1.json");
    assertEquals(0, Iterables.size(issue.getComments()));
    final BasicPriority priority = issue.getPriority();
    assertNull(priority);
    assertEquals("Pivotal Tracker provides time tracking information on the project level.\n"
        + "JIRA stores time tracking information on issue level, so this issue has been created to store imported time tracking information.", issue.getDescription());
    assertEquals("TIMETRACKING", issue.getProject().getKey());
    assertNull(issue.getDueDate());
    assertEquals(0, Iterables.size(issue.getAttachments()));
    assertNull(issue.getIssueLinks());
    assertNull(issue.getField("customfield_10000").getValue());
    assertThat(issue.getComponents(), IsEmptyIterable.<BasicComponent>emptyIterable());
    assertEquals(2, Iterables.size(issue.getWorklogs()));
    assertEquals(0, issue.getWatchers().getNumWatchers());
    assertFalse(issue.getWatchers().isWatching());
    assertEquals(new TimeTracking(null, null, 840), issue.getTimeTracking());

    assertNull(issue.getWorklogs().iterator().next().getVisibility());
    assertNull(Iterables.get(issue.getWorklogs(), 1).getVisibility());
  }
View Full Code Here

    assertNull(Iterables.get(issue.getWorklogs(), 1).getVisibility());
  }

    @Test
    public void testParseIssueWithProjectNamePresentInRepresentation() throws JSONException {
        final Issue issue = parseIssue("/json/issue/issue-with-project-name-present.json");
        assertEquals("My Test Project", issue.getProject().getName());
    }
View Full Code Here

        assertEquals("My Test Project", issue.getProject().getName());
    }

    @Test
    public void testParseIssueJiraRepresentationJrjc49() throws JSONException {
        final Issue issue = parseIssue("/json/issue/jrjc49.json");
        final Iterable<Worklog> worklogs = issue.getWorklogs();
        assertEquals(1, Iterables.size(worklogs));
        final Worklog worklog = Iterables.get(worklogs, 0);
        assertNull(worklog.getComment());
        assertEquals(180, worklog.getMinutesSpent());
        assertEquals("Sample, User", worklog.getAuthor().getDisplayName());
View Full Code Here

    }

  @Test
  public void testParseIssueJira5x0RepresentationNullCustomField() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-5.0-null-custom-field.json");
    assertEquals(null, issue.getField("customfield_10000").getValue());
    assertNull(issue.getIssueLinks());
  }
View Full Code Here

    assertNull(issue.getIssueLinks());
  }

  @Test
  public void issueWithSubtasks() throws JSONException {
    final Issue issue = parseIssue("/json/issue/subtasks-5.json");
    Iterable<Subtask> subtasks = issue.getSubtasks();
    assertEquals(1, Iterables.size(subtasks));
    Subtask subtask = Iterables.get(subtasks, 0, null);
    assertNotNull(subtask);
    assertEquals("SAM-2", subtask.getIssueKey());
    assertEquals("Open", subtask.getStatus().getName());
View Full Code Here

    assertEquals("Subtask", subtask.getIssueType().getName());
  }

  @Test
  public void issueWithChangelog() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-5.0-with-changelog.json");
    assertEquals("HST-1", issue.getKey());

    final Iterable<ChangelogGroup> changelog = issue.getChangelog();
    assertNotNull(changelog);

    assertEquals(4, Iterables.size(changelog));
    final Iterator<ChangelogGroup> iterator = changelog.iterator();
View Full Code Here

    assertEquals(expectedItems, changelogGroup.getItems());
  }

  @Test
  public void testParseIssueWithLabelsForJira5x0() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-5.0-with-labels.json");
    assertThat(issue.getLabels(), containsInAnyOrder("a", "bcds"));
  }
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.domain.Issue

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.