@Test
public void testSearchFactTypes() throws Exception {

  when(getTiService().searchFactTypes(any(), isA(SearchFactTypeRequest.class))).then(i -> StreamingResultSet.<FactType>builder().setValues(createFactTypes()).build());
  Response response = target("/v1/factType").request().get();
  JsonNode payload = getPayload(response);
  assertEquals(200, response.getStatus());
  assertTrue(payload.isArray());
  assertEquals(3, payload.size());
  verify(getTiService(), times(1)).searchFactTypes(notNull(), isA(SearchFactTypeRequest.class));
}