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

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


    assertFalse(watchers.isWatching());
    assertEquals(toUri("http://localhost:8090/jira/rest/api/2/issue/TST-2/watchers"), watchers.getSelf());
    assertEquals(1, watchers.getNumWatchers());

    // time tracking
    assertEquals(new TimeTracking(0, 0, 145), issue.getTimeTracking());

    // attachments
    final Iterable<Attachment> attachments = issue.getAttachments();
    assertEquals(7, Iterables.size(attachments));
    final Attachment attachment = findAttachmentByFileName(attachments, "avatar1.png");
View Full Code Here


    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

    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

    final SearchResult searchResult = client.getSearchClient().searchJql(jql, null, null, fields).claim();
    final Issue issue = Iterables.getOnlyElement(searchResult.getIssues());

    assertEquals("TST-2", issue.getKey());
    assertEquals("Testing attachem2", issue.getSummary());
    assertEquals(new TimeTracking(0, 0, 145), issue.getTimeTracking());
    assertThat(issue.getComponents(), NamedEntityMatchers.entitiesWithNames("Component A", "Component B"));

    // comments
    final Iterable<Comment> comments = issue.getComments();
    assertEquals(3, Iterables.size(comments));
View Full Code Here

    final Watchers watchers = client.getIssueClient().getWatchers(issue.getWatchers().getSelf()).claim();
    assertEquals(1, watchers.getNumWatchers());
    assertFalse(watchers.isWatching());
    assertTrue("JRADEV-3594 bug!!!", Iterables.isEmpty(watchers.getUsers()));
    // to save time
    assertEquals(new TimeTracking(2700, 2400, null), issue.getTimeTracking());
  }
View Full Code Here

    assertEquals(3, Iterables.size(issue.getComments()));
    final Iterable<String> expectedExpandos = isJira5xOrNewer()
        ? ImmutableList.of("renderedFields", "names", "schema", "transitions", "operations", "editmeta", "changelog")
        : ImmutableList.of("html");
    assertThat(ImmutableList.copyOf(issue.getExpandos()), containsInAnyOrder(toArray(expectedExpandos, String.class)));
    assertEquals(new TimeTracking(null, 0, 190), issue.getTimeTracking());
    assertTrue(Iterables.size(issue.getFields()) > 0);

    assertEquals(IntegrationTestUtil.START_PROGRESS_TRANSITION_ID, Iterables.size(issue.getAttachments()));
    final Iterable<Attachment> items = issue.getAttachments();
    assertNotNull(items);
View Full Code Here

        } else if ("datetime".equals(fieldType)) {
          value = JsonParseUtil.formatDateTime(new DateTime());
        } else if ("array".equals(fieldType) && "string".equals(fieldInfo.getSchema().getItems())) {
          value = ImmutableList.of("one", "two", "three");
        } else if ("timetracking".equals(fieldType)) {
          value = new TimeTracking(60, 40, null); // time spent is not allowed
        } else {
          if (fieldInfo.isRequired()) {
            fail("I don't know how to fill that required field, sorry.");
          } else {
            log.log("\t\t| field value is not required, leaving blank");
View Full Code Here

    final SearchResult searchResult = client.getSearchClient().searchJql(jql, null, null, fields).claim();
    final Issue issue = Iterables.getOnlyElement(searchResult.getIssues());

    assertEquals("TST-2", issue.getKey());
    assertEquals("Testing attachem2", issue.getSummary());
    assertEquals(new TimeTracking(0, 0, 145), issue.getTimeTracking());
    assertThat(issue.getComponents(), NamedEntityMatchers.entitiesWithNames("Component A", "Component B"));

    // comments
    final Iterable<Comment> comments = issue.getComments();
    assertEquals(3, Iterables.size(comments));
View Full Code Here

        } else if ("datetime".equals(fieldType)) {
          value = JsonParseUtil.formatDateTime(new DateTime());
        } else if ("array".equals(fieldType) && "string".equals(fieldInfo.getSchema().getItems())) {
          value = ImmutableList.of("one", "two", "three");
        } else if ("timetracking".equals(fieldType)) {
          value = new TimeTracking(60, 40, null); // time spent is not allowed
        } else {
          if (fieldInfo.isRequired()) {
            fail("I don't know how to fill that required field, sorry.");
          } else {
            log.log("\t\t| field value is not required, leaving blank");
View Full Code Here

      worklogs = Collections.emptyList();
    }


    final BasicWatchers watchers = getOptionalNestedField(issueJson, WATCHER_FIELD.id, watchersJsonParser);
    final TimeTracking timeTracking = getOptionalNestedField(issueJson, TIMETRACKING_FIELD.id, new TimeTrackingJsonParserV5());

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

    final Collection<ChangelogGroup> changelog = parseOptionalArray(
View Full Code Here

TOP

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

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.