@Test
public void testTraverseByObjectId() throws Exception {

  UUID id = UUID.randomUUID();
  Long before = 1L;
  Long after = 2L;
  when(getTiService().traverse(any(), isA(TraverseGraphByObjectsRequest.class))).then(i -> {
    TraverseGraphByObjectsRequest request = i.getArgument(1);
    assertEquals(set(id.toString()), request.getObjects());
    assertEquals(after, request.getAfter());
    assertEquals(before, request.getBefore());
    assertTrue(request.getIncludeRetracted());
    return StreamingResultSet.<String>builder().setValues(ListUtils.list("something")).build();
  });
  TraverseGraphRequest request = new TraverseGraphRequest()
          .setAfter(after)
          .setBefore(before)
          .setIncludeRetracted(true)
          .setQuery("g.values('value')");
  Response response = target(String.format("/v1/traverse/object/%s", id)).request().post(Entity.json(request));
  JsonNode payload = getPayload(response);
  assertEquals(200, response.getStatus());
  assertTrue(payload.isArray());
  assertEquals(1, payload.size());
  assertEquals("something", payload.get(0).asText());
  verify(getTiService(), times(1)).traverse(notNull(), isA(TraverseGraphByObjectsRequest.class));
}