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

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


    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

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"), basicStatus);
  }
View Full Code Here

public class BasicStatusJsonParser implements JsonParser<BasicStatus> {
  @Override
    public BasicStatus parse(JSONObject json) throws JSONException {
    final URI self = JsonParseUtil.getSelfUri(json);
    final String name = json.getString("name");
    return new BasicStatus(self, name);
  }
View Full Code Here

*/
public class StatusJsonParser implements JsonParser<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"));
    return new Status(basicStatus.getSelf(), basicStatus.getName(), description, iconUri);
  }
View Full Code Here

    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

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

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.