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.assertEquals(Long.valueOf(10000), project.getId());
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());
}