@Test
public void testGetFactComments() throws Exception {

  UUID fact = UUID.randomUUID();
  when(getTiService().getFactComments(any(), isA(GetFactCommentsRequest.class))).then(i -> {
    GetFactCommentsRequest request = i.getArgument(1);
    assertEquals(fact, request.getFact());
    assertEquals(1480520820000L, (long) request.getBefore());
    assertEquals(1480520821000L, (long) request.getAfter());
    return StreamingResultSet.<FactComment>builder().setValues(createFactComments()).build();
  });
  Response response = target(String.format("/v1/fact/uuid/%s/comments", fact))
          .queryParam("before", "2016-11-30T15:47:00Z")
          .queryParam("after", "2016-11-30T15:47:01Z")
          .request()
          .get();
  JsonNode payload = getPayload(response);
  assertEquals(200, response.getStatus());
  assertTrue(payload.isArray());
  assertEquals(3, payload.size());
  verify(getTiService(), times(1)).getFactComments(notNull(), isA(GetFactCommentsRequest.class));
}