@Test
public void testSearchFacts() throws Exception {

  when(getTiService().searchFacts(any(), isA(SearchFactRequest.class))).then(i -> StreamingResultSet.<Fact>builder().setValues(createFacts()).build());
  Response response = target("/v1/fact/search").request().post(Entity.json(new SearchFactRequest()));
  JsonNode payload = getPayload(response);
  assertEquals(200, response.getStatus());
  assertTrue(payload.isArray());
  assertEquals(3, payload.size());
  verify(getTiService(), times(1)).searchFacts(notNull(), isA(SearchFactRequest.class));
}