@Test
public void testSearchObjectFactsById() throws Exception {

  UUID id = UUID.randomUUID();
  when(getTiService().searchObjectFacts(any(), isA(SearchObjectFactsRequest.class))).then(i -> {
    assertEquals(id, i.<SearchObjectFactsRequest>getArgument(1).getObjectID());
    return StreamingResultSet.<Fact>builder().setValues(createFacts()).build();
  });
  Response response = target(String.format("/v1/object/uuid/%s/facts", id)).request().post(Entity.json(new SearchObjectFactsRequest()));
  JsonNode payload = getPayload(response);
  assertEquals(200, response.getStatus());
  assertTrue(payload.isArray());
  assertEquals(3, payload.size());
  verify(getTiService(), times(1)).searchObjectFacts(notNull(), isA(SearchObjectFactsRequest.class));
}