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

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


  }

  @Test
  public void testParseIssueWhenWatchersAndVotersAreSwitchedOff() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-no-votes-no-watchers.json");
    assertNull(issue.getWatchers());
    assertNull(issue.getVotes());
  }
View Full Code Here


    assertNull(issue.getVotes());
  }

  @Test
  public void testParseUnassignedIssue() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-unassigned.json");
    assertNull(issue.getAssignee());
  }
View Full Code Here

    assertNull(issue.getAssignee());
  }

  @Test
  public void testParseNoTimeTrackingInfo() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-unassigned.json");
    assertNull(issue.getTimeTracking());
  }
View Full Code Here

    assertNull(issue.getTimeTracking());
  }

  @Test
  public void testParseUnassignedIssueJira4x3() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-unassigned-jira-4.3.json");
    assertNull(issue.getAssignee());
  }
View Full Code Here

    assertNull(issue.getAssignee());
  }

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

  }
View Full Code Here

  }

  @Test
  public void testParseIssueWithVisibilityJira4x3() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-visibility-jira-4.3.json");
    assertEquals(Visibility.role("Administrators"), issue.getComments().iterator().next().getVisibility());
    assertEquals(Visibility.role("Developers"), Iterables.get(issue.getWorklogs(), 1).getVisibility());
    assertEquals(Visibility.group("jira-users"), Iterables.get(issue.getWorklogs(), 2).getVisibility());
  }
View Full Code Here

    assertEquals(Visibility.group("jira-users"), Iterables.get(issue.getWorklogs(), 2).getVisibility());
  }

  @Test
  public void testParseIssueWithUserPickerCustomFieldFilledOut() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-user-picker-custom-field-filled-out.json");
    final Field extraUserField = issue.getFieldByName("Extra User");
    assertNotNull(extraUserField);
    assertEquals(BasicUser.class, extraUserField.getValue().getClass());
    assertEquals(TestConstants.USER1, extraUserField.getValue());
  }
View Full Code Here

    assertEquals(TestConstants.USER1, extraUserField.getValue());
  }

  @Test
  public void testParseIssueWithUserPickerCustomFieldEmpty() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-user-picker-custom-field-empty.json");
    final Field extraUserField = issue.getFieldByName("Extra User");
    assertNotNull(extraUserField);
    assertNull(extraUserField.getValue());
  }
View Full Code Here

    assertNull(extraUserField.getValue());
  }

  @Test
  public void testParseIssueJira5x0Representation() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-5.0.json");
    assertEquals(3, Iterables.size(issue.getComments()));
    final BasicPriority priority = issue.getPriority();
    assertNotNull(priority);
    assertEquals("Major", priority.getName());
    assertEquals("my description", issue.getDescription());
    assertEquals("TST", issue.getProject().getKey());
    assertNotNull(issue.getDueDate());
    assertEquals(toDateTimeFromIsoDate("2010-07-05"), issue.getDueDate());
    assertEquals(4, Iterables.size(issue.getAttachments()));
    assertEquals(1, Iterables.size(issue.getIssueLinks()));
    assertEquals(1.457, issue.getField("customfield_10000").getValue());
    assertThat(Iterables.transform(issue.getComponents(), new BasicComponentNameExtractionFunction()), containsInAnyOrder("Component A", "Component B"));
    assertEquals(2, Iterables.size(issue.getWorklogs()));
    assertEquals(1, issue.getWatchers().getNumWatchers());
    assertFalse(issue.getWatchers().isWatching());
    assertEquals(new TimeTracking(2700, 2220, 180), issue.getTimeTracking());

    assertEquals(Visibility.role("Developers"), issue.getWorklogs().iterator().next().getVisibility());
    assertEquals(Visibility.group("jira-users"), Iterables.get(issue.getWorklogs(), 1).getVisibility());

  }
View Full Code Here

    final Set<String> labels = Sets.newHashSet(parseOptionalArrayNotNullable(shouldUseNestedValueAttribute, s,
        jsonWeakParserForString, FIELDS, LABELS_FIELD.id));

    final Collection<ChangelogGroup> changelog = parseOptionalArray(false, s, new JsonWeakParserForJsonObject<ChangelogGroup>(changelogJsonParser), "changelog", "histories");
    return new Issue(summary, JsonParseUtil.getSelfUri(s), s.getString("key"), project, issueType, status,
        description, priority, resolution, attachments, reporter, assignee, creationDate, updateDate,
        dueDate, affectedVersions, fixVersions, components, timeTracking, fields, comments,
        transitionsUri != null ? JsonParseUtil.parseURI(transitionsUri) : null, issueLinks,
        votes, worklogs, watchers, expandos, subtasks, changelog, labels);
  }
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.