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

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


    return parser.parse(issueJson);
  }

  @Test
  public void testParseIssueWithResolution() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-all-expanded-with-resolution.json");
    assertEquals("Incomplete", issue.getResolution().getName());

  }
View Full Code Here


  }

  @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-no-time-tracking.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-no-time-tracking.json");
    assertNull(issue.getTimeTracking());
  }
View Full Code Here

    assertNull(issue.getTimeTracking());
  }

  @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 testParseIssueWithVisibility() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-visibility.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(TestConstants.USER1, extraUserField.getValue());
//  }

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

    assertNull(extraUserIssueField.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());
    assertEquals(Long.valueOf(10000), issue.getId());
    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(), EntityHelper.GET_ENTITY_NAME_FUNCTION), 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

  }

  @Test
  public void testParseIssueJira50Representation() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-5.0-1.json");
    assertEquals(Long.valueOf(10001), issue.getId());
    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

TOP

Related Classes of com.atlassian.jira.rest.client.api.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.