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

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


        } 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 Watchers watchers = client.getIssueClient().getWatchers(issue.getWatchers().getSelf(), pm);
    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

  @Override
  public TimeTracking parse(JSONObject json) throws JSONException {
    final Integer originalEstimateMinutes = JsonParseUtil.parseOptionInteger(json, "originalEstimateSeconds");
    final Integer timeRemainingMinutes = JsonParseUtil.parseOptionInteger(json, "remainingEstimateSeconds");
    final Integer timeSpentMinutes = JsonParseUtil.parseOptionInteger(json, "timeSpentSeconds");
    return new TimeTracking(originalEstimateMinutes != null ? originalEstimateMinutes / 60 : null,
        timeRemainingMinutes != null ? timeRemainingMinutes / 60 : null,
        timeSpentMinutes != null ? timeSpentMinutes / 60 : null);
  }
View Full Code Here

    final Watchers watchers = client.getIssueClient().getWatchers(issue.getWatchers().getSelf(), pm);
    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

      worklogs = parseOptionalArray(shouldUseNestedValueAttribute, s, new JsonWeakParserForJsonObject<Worklog>(worklogJsonParser), FIELDS, WORKLOG_FIELD.id);
    }

    final BasicWatchers watchers = getOptionalField(shouldUseNestedValueAttribute, s,
        isJira5x0OrNewer ? WATCHER_FIELD.id : WATCHER_PRE_5_0_FIELD.id, watchersJsonParser);
    final TimeTracking timeTracking = getOptionalField(shouldUseNestedValueAttribute, s, TIMETRACKING_FIELD.id,
        isJira5x0OrNewer ? new TimeTrackingJsonParserV5() : new TimeTrackingJsonParser());

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

    // watchers
    final BasicWatchers watchers = issue.getWatchers();
    assertFalse(watchers.isWatching());
    assertEquals(toUri("http://localhost:8090/jira/rest/api/latest/issue/TST-2/watchers"), watchers.getSelf());
    assertEquals(1, watchers.getNumWatchers());
    assertEquals(new TimeTracking(0, 0, 145), issue.getTimeTracking());

    // attachments
    final Iterable<Attachment> attachments = issue.getAttachments();
    assertEquals(3, Iterables.size(attachments));
    final Attachment attachment = attachments.iterator().next();
View Full Code Here

    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

    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

TOP

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