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

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


    assertTrue(serverInfo.getServerTime().isBefore(new DateTime().plusMinutes(5)));
  }

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


    });
  }

  @Test
  public void testGetIssueType() {
    final BasicIssueType basicIssueType = client.getIssueClient().getIssue("TST-1", pm).getIssueType();
    final IssueType issueType = client.getMetadataClient().getIssueType(basicIssueType.getSelf(), pm);
    assertEquals("Bug", issueType.getName());
    assertEquals("A problem which impairs or prevents the functions of the product.", issueType.getDescription());
    Long expectedId = isJira5xOrNewer() ? 1L : null;
    assertEquals(expectedId, issueType.getId());
    assertTrue(issueType.getIconUri().toString().endsWith("bug.gif"));
View Full Code Here

public class BasicIssueTypeJsonParserTest {
    @Test
    public void testParse() throws JSONException {
        BasicIssueTypeJsonParser parser = new BasicIssueTypeJsonParser();
        final BasicIssueType issueType = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/issueType/valid.json"));
        assertEquals(new BasicIssueType(toUri("http://localhost:8090/jira/rest/api/latest/issueType/1"), 1L, "Bug", true), issueType);
    }
View Full Code Here

    }

  @Test
  public void testParseWithoutId() throws JSONException {
    BasicIssueTypeJsonParser parser = new BasicIssueTypeJsonParser();
    final BasicIssueType issueType = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/issueType/valid-without-id.json"));
    assertEquals(new BasicIssueType(toUri("http://localhost:8090/jira/rest/api/latest/issueType/1"), null, "Bug", true), issueType);
  }
View Full Code Here

    assertTrue(serverInfo.getServerTime().isBefore(new DateTime().plusMinutes(5)));
  }

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

    });
  }

  @Test
  public void testGetIssueType() {
    final BasicIssueType basicIssueType = client.getIssueClient().getIssue("TST-1", pm).getIssueType();
    final IssueType issueType = client.getMetadataClient().getIssueType(basicIssueType.getSelf(), pm);
    assertEquals("Bug", issueType.getName());
    assertEquals("A problem which impairs or prevents the functions of the product.", issueType.getDescription());
    Long expectedId = isJira5xOrNewer() ? 1L : null;
    assertEquals(expectedId, issueType.getId());
    assertTrue(issueType.getIconUri().toString().endsWith("bug.gif"));
View Full Code Here

public class IssueJsonParserTest {
  @Test
  public void testParseIssue() throws Exception {
    final Issue issue = parseIssue("/json/issue/valid-all-expanded.json");
    assertExpectedIssue(issue);
    assertEquals(new BasicIssueType(toUri("http://localhost:8090/jira/rest/api/latest/issueType/1"), 1L, "Bug", false),
        issue.getIssueType());
  }
View Full Code Here

  @Test
  public void testParseIssueJira4x2() throws Exception {
    final Issue issue = parseIssue("/json/issue/valid-all-expanded-jira-4-2.json");
    assertExpectedIssue(issue);
    assertEquals(new BasicIssueType(toUri("http://localhost:8090/jira/rest/api/latest/issueType/1"), null, "Bug", false),
        issue.getIssueType());
  }
View Full Code Here

    final String description = getOptionalFieldStringUnisex(shouldUseNestedValueAttribute, s, DESCRIPTION_FIELD.id);

    final Collection<Attachment> attachments = parseOptionalArray(shouldUseNestedValueAttribute, s, new JsonWeakParserForJsonObject<Attachment>(attachmentJsonParser), FIELDS, ATTACHMENT_FIELD.id);
    final Collection<Field> fields = isJira5x0OrNewer ? parseFieldsJira5x0(s) : parseFields(s.getJSONObject(FIELDS));

    final BasicIssueType issueType = issueTypeJsonParser.parse(getFieldUnisex(s, ISSUE_TYPE_FIELD.id));
    final DateTime creationDate = JsonParseUtil.parseDateTime(getFieldStringUnisex(s, CREATED_FIELD.id));
    final DateTime updateDate = JsonParseUtil.parseDateTime(getFieldStringUnisex(s, UPDATED_FIELD.id));

    final String dueDateString = getOptionalFieldStringUnisex(shouldUseNestedValueAttribute, s, DUE_DATE_FIELD.id);
    final DateTime dueDate = dueDateString == null ? null : JsonParseUtil.parseDateTimeOrDate(dueDateString);
View Full Code Here

    public BasicIssueType parse(JSONObject json) throws JSONException {
        final URI selfUri = JsonParseUtil.getSelfUri(json);
        final Long id = JsonParseUtil.getOptionalLong(json, "id");
        final String name = json.getString("name");
        final boolean isSubtask = json.getBoolean("subtask");
        return new BasicIssueType(selfUri, id, name, isSubtask);
    }
View Full Code Here

TOP

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

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.