@Test
public void testSearchObjects() throws Exception {

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