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

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


  }

  @JiraBuildNumberDependent(ServerVersionConstants.BN_JIRA_4_4)
  @Test
  public void testGetProjectRoleWithRoleKeyErrorCode() {
    final Project anonProject = client.getProjectClient().getProject(ANONYMOUS_PROJECT_KEY).claim();
    exception.expect(RestClientException.class);
    exception.expectMessage("Can not retrieve a role actor for a null project role.");
    client.getProjectRolesRestClient().getRole(anonProject.getSelf(), -1l).claim();
  }
View Full Code Here


public class ProjectJsonParserTest {
  private final ProjectJsonParser parser = new ProjectJsonParser();

  @Test
  public void testParse() throws Exception {
    final Project project = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/project/valid.json"));
    Assert.assertEquals(TestUtil.toUri("http://localhost:8090/jira/rest/api/latest/project/TST"), project.getSelf());
    Assert.assertEquals("This is my description here.\r\nAnother line.", project.getDescription());
    assertEquals(TestConstants.USER_ADMIN_BASIC_DEPRECATED, project.getLead());
    Assert.assertEquals("http://example.com", project.getUri().toString());
    Assert.assertEquals("TST", project.getKey());
    Assert.assertThat(project.getVersions(), IsIterableContainingInAnyOrder
        .containsInAnyOrder(TestConstants.VERSION_1, TestConstants.VERSION_1_1));
    Assert.assertThat(project.getComponents(), IsIterableContainingInAnyOrder
        .containsInAnyOrder(TestConstants.BCOMPONENT_A, TestConstants.BCOMPONENT_B));
    Assert.assertNull(project.getName());
    final OptionalIterable<IssueType> issueTypes = project.getIssueTypes();
    Assert.assertFalse(issueTypes.isSupported());
    Assert.assertThat(issueTypes, IsEmptyIterable.<IssueType>emptyIterable());
  }
View Full Code Here

    Assert.assertThat(issueTypes, IsEmptyIterable.<IssueType>emptyIterable());
  }

  @Test
  public void testParseProjectWithNoUrl() throws JSONException {
    final Project project = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/project/project-no-url.json"));
    Assert.assertEquals("MYT", project.getKey());
    Assert.assertNull(project.getUri());
    Assert.assertNull(project.getDescription());
  }
View Full Code Here

    Assert.assertNull(project.getDescription());
  }

  @Test
  public void testParseProjectInJira4x4() throws JSONException, URISyntaxException {
    final Project project = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/project/project-jira-4-4.json"));
    Assert.assertEquals("TST", project.getKey()); //2010-08-25
    Assert.assertEquals(new DateMidnight(2010, 8, 25).toInstant(), Iterables.getLast(project.getVersions()).getReleaseDate()
        .toInstant());
    Assert.assertEquals("Test Project", project.getName());
    final OptionalIterable<IssueType> issueTypes = project.getIssueTypes();
    Assert.assertTrue(issueTypes.isSupported());
    Assert.assertThat(issueTypes, IsIterableContainingInAnyOrder.containsInAnyOrder(
        new IssueType(TestUtil
            .toUri("http://localhost:2990/jira/rest/api/latest/issueType/1"), null, "Bug", false, null, null),
        new IssueType(TestUtil
View Full Code Here

    ));
  }

  @Test
  public void testParseProjectInJira5x0() throws JSONException, URISyntaxException {
    final Project project = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/project/project-jira-5-0.json"));
    Assert.assertEquals("TST", project.getKey());
    Assert.assertEquals(new DateMidnight(2010, 8, 25).toInstant(), Iterables.getLast(project.getVersions()).getReleaseDate()
        .toInstant());
    Assert.assertEquals("Test Project", project.getName());
    final OptionalIterable<IssueType> issueTypes = project.getIssueTypes();
    Assert.assertTrue(issueTypes.isSupported());
    Assert.assertThat(issueTypes, IsIterableContainingInAnyOrder.containsInAnyOrder(
        new IssueType(TestUtil
            .toUri("http://localhost:2990/jira/rest/api/latest/issuetype/1"), 1L, "Bug", false, "A problem which impairs or prevents the functions of the product.", TestUtil
            .toUri("http://localhost:2990/jira/images/icons/bug.gif")),
View Full Code Here

    ));
  }

  @Test
  public void testParseProjectWithBasicRoles() throws JSONException, URISyntaxException {
    final Project project = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/project/project-jira-5-0.json"));
    final Iterable<BasicProjectRole> projectRoles = project.getProjectRoles();
    Assert.assertThat(projectRoles, IsIterableContainingInAnyOrder.containsInAnyOrder(
        new BasicProjectRole(TestUtil
            .toUri("http://localhost:2990/jira/rest/api/latest/project/TST/role/10000"), "Users"),
        new BasicProjectRole(TestUtil
            .toUri("http://localhost:2990/jira/rest/api/latest/project/TST/role/10001"), "Developers"),
View Full Code Here

TOP

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

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.