@Test
public void testSearchOrigins() throws Exception {

  when(getTiService().searchOrigins(any(), isA(SearchOriginRequest.class))).then(i -> {
    SearchOriginRequest request = i.getArgument(1);
    assertTrue(request.getIncludeDeleted());
    assertEquals(25, (int) request.getLimit());
    return StreamingResultSet.<Origin>builder().setValues(createOrigins()).build();
  });
  Response response = target("/v1/origin")
          .queryParam("includeDeleted", true)
          .queryParam("limit", 25)
          .request()
          .get();
  JsonNode payload = getPayload(response);
  assertEquals(200, response.getStatus());
  assertTrue(payload.isArray());
  assertEquals(3, payload.size());
  verify(getTiService(), times(1)).searchOrigins(notNull(), isA(SearchOriginRequest.class));
}