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

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


  @Test
  public void testParseIssueWithOperations() throws JSONException {
    final Issue issue = parseIssue("/json/issue/valid-5.0-with-operations.json");
    assertThat(issue.getOperations(), is(new Operations(Collections.singleton(new OperationGroup(
        "opsbar-transitions",
        Collections.singleton(new OperationLink("action_id_4", "issueaction-workflow-transition",
            "Start Progress", "Start work on the issue", "/secure/WorkflowUIDispatcher.jspa?id=93813&action=4&atl_token=",
            10, null)),
        Collections.singleton(new OperationGroup(
            null,
            Collections.<OperationLink>emptyList(),
View Full Code Here


import static org.junit.Assert.*;

public class OperationLinkJsonParserTest {
  @Test
  public void testParseFull() throws Exception {
    testParseResource("/json/operationLink/valid.json", is(new OperationLink("comment-issue",
        "issueaction-comment-issue add-issue-comment", "Comment", "Comment on this issue",
        "/secure/AddComment!default.jspa?id=10100", 10, "aui-icon aui-icon-small aui-iconfont-comment icon-comment")));
  }
View Full Code Here

        "/secure/AddComment!default.jspa?id=10100", 10, "aui-icon aui-icon-small aui-iconfont-comment icon-comment")));
  }

  @Test
  public void testParsePartial() throws Exception {
    testParseResource("/json/operationLink/with-label-href-only.json", is(new OperationLink(null,
        null, "Comment", null, "/secure/AddComment!default.jspa?id=10100", null, null)));
  }
View Full Code Here

        null, "Comment", null, "/secure/AddComment!default.jspa?id=10100", null, null)));
  }

  private void testParseResource(String resourcePath, Matcher<OperationLink> expected) throws JSONException {
    OperationLinkJsonParser parser = new OperationLinkJsonParser();
    OperationLink actual = parser.parse(ResourceUtil.getJsonObjectFromResource(resourcePath));
    assertThat(actual, expected);
  }
View Full Code Here

  public void testParse() throws Exception {
    OperationsJsonParser parser = new OperationsJsonParser();
    Operations actual = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/operations/valid.json"));
    assertThat(actual, is(new Operations(Collections.singleton(new OperationGroup(
        "opsbar-transitions",
        Collections.singleton(new OperationLink("action_id_4", "issueaction-workflow-transition",
            "Start Progress", "Start work on the issue", "/secure/WorkflowUIDispatcher.jspa?id=93813&action=4&atl_token=",
            10, null)),
        Collections.singleton(new OperationGroup(
            null,
            Collections.<OperationLink>emptyList(),
View Full Code Here

    // when
    OperationGroup actual = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/operationGroup/valid.json"));

    // then
    String id = "opsbar-transitions";
    Set<OperationLink> links = Collections.singleton(new OperationLink("action_id_4", "issueaction-workflow-transition",
        "Start Progress", "Start work on the issue", "/secure/WorkflowUIDispatcher.jspa?id=93813&action=4&atl_token=",
        10, null));
    Set<OperationGroup> groups = Collections.singleton(new OperationGroup(null, EMPTY_LINKS, EMPTY_GROUPS,
        new OperationHeader("opsbar-transitions_more", "Workflow", null, null), null));
    int weight = 20;
View Full Code Here

    final String label = json.getString("label");
    final String title = JsonParseUtil.getOptionalString(json, "title");
    final String href = json.getString("href");
    final Integer weight = JsonParseUtil.parseOptionInteger(json, "weight");
    final String iconClass = JsonParseUtil.getOptionalString(json, "iconClass");
    return new OperationLink(id, styleClass, label, title, href, weight, iconClass);
  }
View Full Code Here

TOP

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

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.