}
private void jqlSearchWithAllFieldsImpl(String jql) {
final ImmutableSet<String> fields = ImmutableSet.of("*all");
final SearchResult searchResult = client.getSearchClient().searchJql(jql, null, null, fields).claim();
final Issue issue = Iterables.getOnlyElement(searchResult.getIssues());
assertEquals("TST-2", issue.getKey());
assertEquals("Testing attachem2", issue.getSummary());
assertEquals(new TimeTracking(0, 0, 145), issue.getTimeTracking());
assertThat(issue.getComponents(), NamedEntityMatchers.entitiesWithNames("Component A", "Component B"));
// comments
final Iterable<Comment> comments = issue.getComments();
assertEquals(3, Iterables.size(comments));
assertEquals("a comment viewable only by jira-users", Iterables.getLast(comments).getBody());
// worklogs
final Iterable<Worklog> worklogs = issue.getWorklogs();
assertThat(worklogs, AddressableEntityMatchers.entitiesWithSelf(
resolveURI("rest/api/2/issue/10010/worklog/10010"),
resolveURI("rest/api/2/issue/10010/worklog/10011"),
resolveURI("rest/api/2/issue/10010/worklog/10012"),
resolveURI("rest/api/2/issue/10010/worklog/10020"),
resolveURI("rest/api/2/issue/10010/worklog/10021")
));
final Worklog actualWorklog = Iterables.getLast(worklogs);
final Worklog expectedWorklog = new Worklog(resolveURI("rest/api/2/issue/10010/worklog/10021"),
resolveURI("rest/api/latest/issue/10010"), IntegrationTestUtil.USER_ADMIN, IntegrationTestUtil.USER_ADMIN,
"Another work for 7 min", toDateTime("2010-08-27T15:00:02.104"), toDateTime("2010-08-27T15:00:02.104"),
toDateTime("2010-08-27T14:59:00.000"), 7, null);
assertEquals(expectedWorklog, actualWorklog);
// issue links
assertThat(issue.getIssueLinks(), IsIterableContainingInOrder.contains(
new IssueLink("TST-1", resolveURI("rest/api/2/issue/10000"), new IssueLinkType("Duplicate", "duplicates", IssueLinkType.Direction.OUTBOUND)),
new IssueLink("TST-1", resolveURI("rest/api/2/issue/10000"), new IssueLinkType("Duplicate", "is duplicated by", IssueLinkType.Direction.INBOUND))
));
// fix versions
final Version actualFixVersion = Iterables.getOnlyElement(issue.getFixVersions());
final Version expectedFixVersion = new Version(resolveURI("rest/api/2/version/10000"), 10000L, "1.1", "Some version", false, false, toDateTime("2010-08-25T00:00:00.000"));
assertEquals(expectedFixVersion, actualFixVersion);
// affected versions
assertThat(issue.getAffectedVersions(), IsIterableContainingInOrder.contains(
new Version(resolveURI("rest/api/2/version/10001"), 10001L, "1", "initial version", false, false, null),
new Version(resolveURI("rest/api/2/version/10000"), 10000L, "1.1", "Some version", false, false, toDateTime("2010-08-25T00:00:00.000"))
));
// dates
assertNull(issue.getDueDate());
assertEquals(toDateTime("2010-08-30T10:49:33.000"), issue.getUpdateDate());
assertEquals(toDateTime("2010-07-26T13:29:18.000"), issue.getCreationDate());
// attachments
final Iterable<String> attachmentsNames = EntityHelper.toFileNamesList(issue.getAttachments());
assertThat(attachmentsNames, containsInAnyOrder("10000_thumb_snipe.jpg", "Admal pompa ciepła.pdf",
"apache-tomcat-5.5.30.zip", "jira_logo.gif", "snipe.png", "transparent-png.png"));
}