Examples of IssueLink


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

    assertEquals(TestConstants.USER_ADMIN, issue.getReporter());
    assertEquals(TestConstants.USER1, issue.getAssignee());

    // issue links
    Assert.assertThat(issue.getIssueLinks(), containsInAnyOrder(
        new IssueLink("TST-1", toUri("http://localhost:8090/jira/rest/api/2/issue/10000"),
            new IssueLinkType("Duplicate", "duplicates", IssueLinkType.Direction.OUTBOUND)),
        new IssueLink("TST-1", toUri("http://localhost:8090/jira/rest/api/2/issue/10000"),
            new IssueLinkType("Duplicate", "is duplicated by", IssueLinkType.Direction.INBOUND))
    ));

    // watchers
    final BasicWatchers watchers = issue.getWatchers();
View Full Code Here

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

        toDateTime("2010-08-27T14:59:00.000"), 7, null);
    assertEquals(expectedWorklog, actualWorklog);

    // issue links
    assertThat(issue.getIssueLinks(), IsIterableContainingInOrder.contains(
        new IssueLink("TST-1", resolveURI("rest/api/2/issue/10000"), new IssueLinkType("Duplicate", "duplicates", IssueLinkType.Direction.OUTBOUND)),
        new IssueLink("TST-1", resolveURI("rest/api/2/issue/10000"), new IssueLinkType("Duplicate", "is duplicated by", IssueLinkType.Direction.INBOUND))
    ));

    // fix versions
    final Version actualFixVersion = Iterables.getOnlyElement(issue.getFixVersions());
    final Version expectedFixVersion = new Version(resolveURI("rest/api/2/version/10000"), 10000L, "1.1", "Some version", false, false, toDateTime("2010-08-25T00:00:00.000"));
View Full Code Here

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

    issueClient.linkIssue(new LinkIssuesInput("TST-7", "TST-6", "Duplicate", commentInput)).claim();

    final Issue linkedIssue = issueClient.getIssue("TST-7").claim();
    assertEquals(1, Iterables.size(linkedIssue.getIssueLinks()));
    final IssueLink addedLink = linkedIssue.getIssueLinks().iterator().next();
    assertEquals("Duplicate", addedLink.getIssueLinkType().getName());
    assertEquals("TST-6", addedLink.getTargetIssueKey());
    assertEquals(IssueLinkType.Direction.OUTBOUND, addedLink.getIssueLinkType().getDirection());

    final int expectedNumComments = commentInput != null ? origNumComments + 1 : origNumComments;
    assertEquals(expectedNumComments, Iterables.size(linkedIssue.getComments()));
    if (commentInput != null) {
      final Comment comment = linkedIssue.getComments().iterator().next();
      assertEquals(commentInput.getBody(), comment.getBody());
      assertEquals(IntegrationTestUtil.USER_ADMIN, comment.getAuthor());
      assertEquals(commentInput.getVisibility(), comment.getVisibility());
    } else {
      assertFalse(linkedIssue.getComments().iterator().hasNext());
    }


    final Issue targetIssue = issueClient.getIssue("TST-6").claim();
    final IssueLink targetLink = targetIssue.getIssueLinks().iterator().next();
    assertEquals(IssueLinkType.Direction.INBOUND, targetLink.getIssueLinkType().getDirection());
    assertEquals("Duplicate", targetLink.getIssueLinkType().getName());
  }
View Full Code Here

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

        toDateTime("2010-08-27T14:59:00.000"), 7, null);
    assertEquals(expectedWorklog, actualWorklog);

    // issue links
    assertThat(issue.getIssueLinks(), IsIterableContainingInOrder.contains(
        new IssueLink("TST-1", resolveURI("rest/api/2/issue/10000"), new IssueLinkType("Duplicate", "duplicates", IssueLinkType.Direction.OUTBOUND)),
        new IssueLink("TST-1", resolveURI("rest/api/2/issue/10000"), new IssueLinkType("Duplicate", "is duplicated by", IssueLinkType.Direction.INBOUND))
    ));

    // fix versions
    final Version actualFixVersion = Iterables.getOnlyElement(issue.getFixVersions());
    final Version expectedFixVersion = new Version(resolveURI("rest/api/2/version/10000"), 10000L, "1.1", "Some version", false, false, toDateTime("2010-08-25T00:00:00.000"));
View Full Code Here

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

    issueClient.linkIssue(new LinkIssuesInput("TST-7", "TST-6", "Duplicate", commentInput)).claim();

    final Issue linkedIssue = issueClient.getIssue("TST-7").claim();
    assertEquals(1, Iterables.size(linkedIssue.getIssueLinks()));
    final IssueLink addedLink = linkedIssue.getIssueLinks().iterator().next();
    assertEquals("Duplicate", addedLink.getIssueLinkType().getName());
    assertEquals("TST-6", addedLink.getTargetIssueKey());
    assertEquals(IssueLinkType.Direction.OUTBOUND, addedLink.getIssueLinkType().getDirection());

    final int expectedNumComments = commentInput != null ? origNumComments + 1 : origNumComments;
    assertEquals(expectedNumComments, Iterables.size(linkedIssue.getComments()));
    if (commentInput != null) {
      final Comment comment = linkedIssue.getComments().iterator().next();
      assertEquals(commentInput.getBody(), comment.getBody());
      assertEquals(IntegrationTestUtil.USER_ADMIN, comment.getAuthor());
      assertEquals(commentInput.getVisibility(), comment.getVisibility());
    } else {
      assertFalse(linkedIssue.getComments().iterator().hasNext());
    }


    final Issue targetIssue = issueClient.getIssue("TST-6").claim();
    final IssueLink targetLink = targetIssue.getIssueLinks().iterator().next();
    assertEquals(IssueLinkType.Direction.INBOUND, targetLink.getIssueLinkType().getDirection());
    assertEquals("Duplicate", targetLink.getIssueLinkType().getName());
  }
View Full Code Here

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

        toDateTime("2010-08-27T14:59:00.000"), 7, null);
    assertEquals(expectedWorklog, actualWorklog);

    // issue links
    assertThat(issue.getIssueLinks(), IsIterableContainingInOrder.contains(
        new IssueLink("TST-1", resolveURI("rest/api/2/issue/10000"), new IssueLinkType("Duplicate", "duplicates", IssueLinkType.Direction.OUTBOUND)),
        new IssueLink("TST-1", resolveURI("rest/api/2/issue/10000"), new IssueLinkType("Duplicate", "is duplicated by", IssueLinkType.Direction.INBOUND))
    ));

    // fix versions
    final Version actualFixVersion = Iterables.getOnlyElement(issue.getFixVersions());
    final Version expectedFixVersion = new Version(resolveURI("rest/api/2/version/10000"), 10000L, "1.1", "Some version", false, false, toDateTime("2010-08-25T00:00:00.000"));
View Full Code Here

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

    issueClient.linkIssue(new LinkIssuesInput("TST-7", "TST-6", "Duplicate", commentInput)).claim();

    final Issue linkedIssue = issueClient.getIssue("TST-7").claim();
    assertEquals(1, Iterables.size(linkedIssue.getIssueLinks()));
    final IssueLink addedLink = linkedIssue.getIssueLinks().iterator().next();
    assertEquals("Duplicate", addedLink.getIssueLinkType().getName());
    assertEquals("TST-6", addedLink.getTargetIssueKey());
    assertEquals(IssueLinkType.Direction.OUTBOUND, addedLink.getIssueLinkType().getDirection());

    final int expectedNumComments = commentInput != null ? origNumComments + 1 : origNumComments;
    assertEquals(expectedNumComments, Iterables.size(linkedIssue.getComments()));
    if (commentInput != null) {
      final Comment comment = linkedIssue.getComments().iterator().next();
      assertEquals(commentInput.getBody(), comment.getBody());
      assertEquals(IntegrationTestUtil.USER_ADMIN, comment.getAuthor());
      assertEquals(commentInput.getVisibility(), comment.getVisibility());
    } else {
      assertFalse(linkedIssue.getComments().iterator().hasNext());
    }


    final Issue targetIssue = issueClient.getIssue("TST-6").claim();
    final IssueLink targetLink = targetIssue.getIssueLinks().iterator().next();
    assertEquals(IssueLinkType.Direction.INBOUND, targetLink.getIssueLinkType().getDirection());
    assertEquals("Duplicate", targetLink.getIssueLinkType().getName());
  }
View Full Code Here

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

    final String key = link.getString("key");
    final URI targetIssueUri = JsonParseUtil.parseURI(link.getString("self"));
    final IssueLinkType issueLinkType = new IssueLinkType(issuelinksType.getName(),
        direction.equals(IssueLinkType.Direction.INBOUND) ? issuelinksType.getInward()
            : issuelinksType.getOutward(), direction);
    return new IssueLink(key, targetIssueUri, issueLinkType);
  }
View Full Code Here

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

  @Override
  public IssueLink parse(JSONObject json) throws JSONException {
    final String key = json.getString("issueKey");
    final URI targetIssueUri = JsonParseUtil.parseURI(json.getString("issue"));
    final IssueLinkType issueLinkType = issueLinkTypeJsonParser.parse(json.getJSONObject("type"));
    return new IssueLink(key, targetIssueUri, issueLinkType);
  }
View Full Code Here

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

    issueClient.linkIssue(new LinkIssuesInput("TST-7", "TST-6", "Duplicate", commentInput)).claim();

    final Issue linkedIssue = issueClient.getIssue("TST-7").claim();
    assertEquals(1, Iterables.size(linkedIssue.getIssueLinks()));
    final IssueLink addedLink = linkedIssue.getIssueLinks().iterator().next();
    assertEquals("Duplicate", addedLink.getIssueLinkType().getName());
    assertEquals("TST-6", addedLink.getTargetIssueKey());
    assertEquals(IssueLinkType.Direction.OUTBOUND, addedLink.getIssueLinkType().getDirection());

    final int expectedNumComments = commentInput != null ? origNumComments + 1 : origNumComments;
    assertEquals(expectedNumComments, Iterables.size(linkedIssue.getComments()));
    if (commentInput != null) {
      final Comment comment = linkedIssue.getComments().iterator().next();
      assertEquals(commentInput.getBody(), comment.getBody());
      assertEquals(IntegrationTestUtil.USER_ADMIN, comment.getAuthor());
      assertEquals(commentInput.getVisibility(), comment.getVisibility());
    } else {
      assertFalse(linkedIssue.getComments().iterator().hasNext());
    }


    final Issue targetIssue = issueClient.getIssue("TST-6").claim();
    final IssueLink targetLink = targetIssue.getIssueLinks().iterator().next();
    assertEquals(IssueLinkType.Direction.INBOUND, targetLink.getIssueLinkType().getDirection());
    assertEquals("Duplicate", targetLink.getIssueLinkType().getName());
  }
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.