String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/IssueJsonParserTest/issue-with-components.json"));
Issues issues = new IssueJsonParser().parseIssues(json);
assertThat(issues.components()).hasSize(1);
Component component = issues.component(issues.list().get(0));
assertThat(component.key()).isEqualTo("struts:Action.java");
assertThat(component.id()).isEqualTo(10L);
assertThat(component.qualifier()).isEqualTo("CLA");
assertThat(component.name()).isEqualTo("Action");
assertThat(component.longName()).isEqualTo("org.struts.Action");
assertThat(component.subProjectId()).isEqualTo(2L);
assertThat(component.projectId()).isEqualTo(1L);
assertThat(issues.componentByKey("struts:Action.java").key()).isEqualTo("struts:Action.java");
assertThat(issues.componentById(10).key()).isEqualTo("struts:Action.java");
}