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

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


        Collection<Field> fields = null;
        URI transitionsUri = null;
        Collection<IssueLink> issueLinks = null;
        BasicVotes votes = null;
        Collection<Worklog> worklogs = null;
        BasicWatchers watchers = null;
        Iterable<String> expandos = null;
        Collection<Subtask> subtasks = null;
        Collection<ChangelogGroup> changelog = null;
        Set<String> labels = null;
        JSONObject rawObject = null;
View Full Code Here


    private static BasicWatchers parseValueImpl(JSONObject json) throws JSONException {
        final URI self = JsonParseUtil.getSelfUri(json);
        final boolean isWatching = json.getBoolean("isWatching");
        final int numWatchers = json.getInt("watchCount");
        return new BasicWatchers(self, isWatching, numWatchers);
    }
View Full Code Here

    assertNotNull(votes);
    assertEquals(1, votes.getVotes());
    assertEquals(true, votes.hasVoted());

    // watchers
    final BasicWatchers watchers = issue.getWatchers();
    assertNotNull(watchers);
    assertEquals(1, watchers.getNumWatchers());

    // resolution
    final BasicResolution resolution = issue.getResolution();
    assertNotNull(resolution);
    assertEquals("Incomplete", resolution.getName());
View Full Code Here

            new IssueLinkType("Duplicate", "is duplicated by", IssueLinkType.Direction.INBOUND))
    ));


    // 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));
View Full Code Here

public class WatchersJsonParserTest {
    @Test
    public void testParseBasicWatchers() throws JSONException {
        final JsonObjectParser<BasicWatchers> parser = WatchersJsonParserBuilder.createBasicWatchersParser();
        final BasicWatchers watcher = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/watcher/basic-valid.json"));
        assertEquals(false, watcher.isWatching());
        assertEquals(1, watcher.getNumWatchers());       

    }
View Full Code Here

      }
    } else {
      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,
View Full Code Here

    // now let's vote for it
    restClient.getIssueClient().vote(issue.getVotesUri(), pm);

    // now let's watch it
    final BasicWatchers watchers = issue.getWatchers();
    if (watchers != null) {
      restClient.getIssueClient().watch(watchers.getSelf(), pm);
    }

    // now let's start progress on this issue
    final Iterable<Transition> transitions = restClient.getIssueClient().getTransitions(issue.getTransitionsUri(), pm);
    final Transition startProgressTransition = getTransitionByName(transitions, "Start Progress");
View Full Code Here

            new IssueLinkType("Duplicate", "is duplicated by", IssueLinkType.Direction.INBOUND))
    ));


    // 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));
View Full Code Here

      }
    } else {
      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,
View Full Code Here

    private static BasicWatchers parseValueImpl(JSONObject json) throws JSONException {
        final URI self = JsonParseUtil.getSelfUri(json);
        final boolean isWatching = json.getBoolean("isWatching");
        final int numWatchers = json.getInt("watchCount");
        return new BasicWatchers(self, isWatching, numWatchers);
    }
View Full Code Here

TOP

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

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.