@Test
public void testSearchObjectTypes() throws Exception {

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