Examples of BasicWatchers


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

    assertEquals(toDateTime("2010-09-22T18:06:32.000"), issue.getCreationDate());
    assertEquals(IntegrationTestUtil.USER1_FULL, issue.getReporter());
    assertEquals(IntegrationTestUtil.USER_ADMIN_FULL, issue.getAssignee());
    assertEquals(new BasicProject(resolveURI(projectSelf), "TST", "Test Project"), issue.getProject());
    assertEquals(new BasicVotes(resolveURI("rest/api/2/issue/TST-7/votes"), 0, false), issue.getVotes());
    assertEquals(new BasicWatchers(resolveURI("rest/api/2/issue/TST-7/watchers"), false, 0), issue.getWatchers());
    assertEquals(new BasicIssueType(resolveURI("rest/api/2/issuetype/3"), 3L, "Task", false), issue.getIssueType());
  }
View Full Code Here

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

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"));
    Assert.assertEquals(false, watcher.isWatching());
    Assert.assertEquals(1, watcher.getNumWatchers());

  }
View Full Code Here

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

    assertEquals(expectedProject, issue.getProject());

    final BasicVotes expectedVotes = new BasicVotes(toUri("http://localhost:8090/jira/rest/api/2/issue/TST-7/votes"), 0, false);
    assertEquals(expectedVotes, issue.getVotes());

    final BasicWatchers expectedWatchers = new BasicWatchers(toUri("http://localhost:8090/jira/rest/api/2/issue/TST-7/watchers"), false, 0);
    assertEquals(expectedWatchers, issue .getWatchers());

    final BasicIssueType expectedIssueType = new BasicIssueType(toUri("http://localhost:8090/jira/rest/api/2/issuetype/3"), 3L, "Task", false);
    assertEquals(expectedIssueType, issue.getIssueType());
  }
View Full Code Here

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

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

    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

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

    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

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

            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

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

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

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

      }
    } 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

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

    // 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
TOP
Copyright © 2018 www.massapi.com. 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.