@Test
public void testSearchObjectFactsByNonExistingTypeValue() throws Exception {

  SearchObjectFactsRequest request = new SearchObjectFactsRequest().setObjectType("type").setObjectValue("value");
  doThrow(AccessDeniedException.class).when(securityContext).checkReadPermission((ObjectRecord) isNull());
  try {
    delegate.handle(request);
    fail();
  } catch (AccessDeniedException ignored) {
    verify(objectTypeHandler).assertObjectTypeExists(request.getObjectType(), "objectType");
    verify(objectFactDao).getObject(request.getObjectType(), request.getObjectValue());
  }
}