@Test
public void testTraverseWithSearchAndParams() throws Exception {

  UUID objectId1 = UUID.randomUUID();
  UUID objectId2 = UUID.randomUUID();
  String query = "g.outE()";
  Long after = 2L;
  Long before = 1L;
  TraverseGraphByObjectSearchRequest request = new TraverseGraphByObjectSearchRequest()
          .setSearch(new SearchObjectRequest())
          .setTraverse(new TraverseGraphRequest()
                  .setQuery(query)
                  .setIncludeRetracted(true)
                  .setAfter(after)
                  .setBefore(before)
                  .setLimit(10)
          );
  Iterator<ObjectRecord> searchResult = set(new ObjectRecord().setId(objectId1), new ObjectRecord().setId(objectId2)).iterator();
  when(objectFactDao.searchObjects(any())).thenReturn(ResultContainer.<ObjectRecord>builder().setValues(searchResult).build());
  delegate.handle(request);
  verify(traverseGraphHandler).traverse(
          eq(set(objectId1, objectId2)),
          eq(query),
          argThat(traverseParams -> {
            assertTrue(traverseParams.isIncludeRetracted());
            assertEquals(after, traverseParams.getAfterTimestamp());
            assertEquals(before, traverseParams.getBeforeTimestamp());
            assertEquals(10, traverseParams.getLimit());
            return true;
          }));
}