Examples of BasicStatus


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

*/
public class StatusJsonParser implements JsonObjectParser<Status> {
  private final BasicStatusJsonParser basicStatusJsonParser = new BasicStatusJsonParser();
  @Override
  public Status parse(JSONObject json) throws JSONException {
    final BasicStatus basicStatus = basicStatusJsonParser.parse(json);
    final String description = json.getString("description");
    final URI iconUri = JsonParseUtil.parseURI(json.getString("iconUrl"));
        final Long id = JsonParseUtil.getOptionalLong(json, "id");
        return new Status(basicStatus.getSelf(), basicStatus.getName(), description, iconUri, id);
  }
View Full Code Here

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

    assertEquals("duplicates", issueType.getOutward());
  }

  @Test
  public void testGetStatus() {
    final BasicStatus basicStatus = client.getIssueClient().getIssue("TST-1", pm).getStatus();
    final Status status = client.getMetadataClient().getStatus(basicStatus.getSelf(), pm);
    assertEquals("The issue is open and ready for the assignee to start work on it.", status.getDescription());
    assertEquals("Open", status.getName());
//    assertTrue(status.getIconUrl().toString().startsWith(jiraUri.toString()));
    assertThat(status.getIconUrl().toString(), anyOf(
        endsWith("status_open.gif"),
View Full Code Here

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

    ));
  }

  @Test
  public void testGetStatusNonExisting() throws Exception {
    final BasicStatus basicStatus = client.getIssueClient().getIssue("TST-1", pm).getStatus();
    TestUtil.assertErrorCode(Response.Status.NOT_FOUND, "The status with id '" +
        TestUtil.getLastPathSegment(basicStatus.getSelf()) + "fake" +
        "' does not exist", new Runnable() {
      @Override
      public void run() {
        client.getMetadataClient().getStatus(TestUtil.toUri(basicStatus.getSelf() + "fake"), pm);
      }
    });
  }
View Full Code Here

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

    if (isJira5x0OrNewer) {
      subtasks = parseOptionalArray(shouldUseNestedValueAttribute, s, new JsonWeakParserForJsonObject<Subtask>(subtaskJsonParser), FIELDS, SUBTASKS_FIELD.id);
    }

    final BasicVotes votes = getOptionalField(shouldUseNestedValueAttribute, s, VOTES_FIELD.id, votesJsonParser);
    final BasicStatus status = statusJsonParser.parse(getFieldUnisex(s, STATUS_FIELD.id));

    final Collection<Version> fixVersions = parseOptionalArray(shouldUseNestedValueAttribute, s, new JsonWeakParserForJsonObject<Version>(versionJsonParser), FIELDS, FIX_VERSIONS_FIELD.id);
    final Collection<Version> affectedVersions = parseOptionalArray(shouldUseNestedValueAttribute, s, new JsonWeakParserForJsonObject<Version>(versionJsonParser), FIELDS, AFFECTS_VERSIONS_FIELD.id);
    final Collection<BasicComponent> components = parseOptionalArray(shouldUseNestedValueAttribute, s, new JsonWeakParserForJsonObject<BasicComponent>(basicComponentJsonParser), FIELDS, COMPONENTS_FIELD.id);
View Full Code Here

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

public class BasicStatusJsonParserTest {
  @Test
  public void testParse() throws JSONException {
    final BasicStatusJsonParser parser = new BasicStatusJsonParser();
    final BasicStatus basicStatus = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/status/valid.json"));
    Assert.assertEquals(new BasicStatus(TestUtil.toUri("http://localhost:8090/jira/rest/api/latest/status/1"), "Open", null), basicStatus);
  }
View Full Code Here

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

    assertEquals("duplicates", issueType.getOutward());
  }

  @Test
  public void testGetStatus() {
    final BasicStatus basicStatus = client.getIssueClient().getIssue("TST-1", pm).getStatus();
    final Status status = client.getMetadataClient().getStatus(basicStatus.getSelf(), pm);
    assertEquals("The issue is open and ready for the assignee to start work on it.", status.getDescription());
    assertTrue(status.getIconUrl().toString().endsWith("status_open.gif"));
    assertEquals("Open", status.getName());
  }
View Full Code Here

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

    assertEquals("Open", status.getName());
  }

  @Test
  public void testGetStatusNonExisting() throws Exception {
    final BasicStatus basicStatus = client.getIssueClient().getIssue("TST-1", pm).getStatus();
    TestUtil.assertErrorCode(Response.Status.NOT_FOUND, "The status with id '" +
        TestUtil.getLastPathSegment(basicStatus.getSelf()) + "fake" +
        "' does not exist", new Runnable() {
      @Override
      public void run() {
        client.getMetadataClient().getStatus(TestUtil.toUri(basicStatus.getSelf() + "fake"), pm);
      }
    });
  }
View Full Code Here

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

    assertEquals("duplicates", issueType.getOutward());
  }

  @Test
  public void testGetStatus() {
    final BasicStatus basicStatus = client.getIssueClient().getIssue("TST-1", pm).getStatus();
    final Status status = client.getMetadataClient().getStatus(basicStatus.getSelf(), pm);
    assertEquals("The issue is open and ready for the assignee to start work on it.", status.getDescription());
    assertTrue(status.getIconUrl().toString().endsWith("status_open.gif"));
    assertEquals("Open", status.getName());
  }
View Full Code Here

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

    assertEquals("Open", status.getName());
  }

  @Test
  public void testGetStatusNonExisting() throws Exception {
    final BasicStatus basicStatus = client.getIssueClient().getIssue("TST-1", pm).getStatus();
    TestUtil.assertErrorCode(Response.Status.NOT_FOUND, "The status with id '" +
        TestUtil.getLastPathSegment(basicStatus.getSelf()) + "fake" +
        "' does not exist", new Runnable() {
      @Override
      public void run() {
        client.getMetadataClient().getStatus(TestUtil.toUri(basicStatus.getSelf() + "fake"), pm);
      }
    });
  }
View Full Code Here

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

    if (isJira5x0OrNewer) {
      subtasks = parseOptionalArray(shouldUseNestedValueAttribute, s, new JsonWeakParserForJsonObject<Subtask>(subtaskJsonParser), FIELDS, SUBTASKS_FIELD.id);
    }

    final BasicVotes votes = getOptionalField(shouldUseNestedValueAttribute, s, VOTES_FIELD.id, votesJsonParser);
    final BasicStatus status = statusJsonParser.parse(getFieldUnisex(s, STATUS_FIELD.id));

    final Collection<Version> fixVersions = parseOptionalArray(shouldUseNestedValueAttribute, s, new JsonWeakParserForJsonObject<Version>(versionJsonParser), FIELDS, FIX_VERSIONS_FIELD.id);
    final Collection<Version> affectedVersions = parseOptionalArray(shouldUseNestedValueAttribute, s, new JsonWeakParserForJsonObject<Version>(versionJsonParser), FIELDS, AFFECTS_VERSIONS_FIELD.id);
    final Collection<BasicComponent> components = parseOptionalArray(shouldUseNestedValueAttribute, s, new JsonWeakParserForJsonObject<BasicComponent>(basicComponentJsonParser), FIELDS, COMPONENTS_FIELD.id);
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.