@Test
public void testSearchObjectFactsByTypeValue() throws Exception {

  String type = "ip";
  String value = "27.13.4.125";
  when(getTiService().searchObjectFacts(any(), isA(SearchObjectFactsRequest.class))).then(i -> {
    SearchObjectFactsRequest request = i.getArgument(1);
    assertEquals(type, request.getObjectType());
    assertEquals(value, request.getObjectValue());
    return StreamingResultSet.<Fact>builder().setValues(createFacts()).build();
  });
  Response response = target(String.format("/v1/object/%s/%s/facts", type, value)).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));
}