@Override
  public <T> ResponseFuture<T> sendRequest(Request<T> request, RequestContext requestContext)
  {
    FutureCallback<Response<T>> callback = new FutureCallback<>();
    sendRequest(request, requestContext, callback);
    return new ResponseFutureImpl<>(callback);
  }
@SuppressWarnings("deprecation")
  @Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "sendRequestAndGetResponseOptions")
  public void testRestLiResponseFuture(SendRequestOption sendRequestOption,
                                       GetResponseOption getResponseOption,
                                       TimeoutOption timeoutOption,
                                       ProtocolVersionOption versionOption,
                                       ProtocolVersion protocolVersion,
                                       String errorResponseHeaderName,
                                       ContentType contentType)
    throws ExecutionException, RemoteInvocationException,
           TimeoutException, InterruptedException, IOException
  {
    final String ERR_KEY = "someErr";
    final String ERR_VALUE = "WHOOPS!";
    final String ERR_MSG = "whoops2";
    final int HTTP_CODE = 200;
    final int APP_CODE = 666;
    final String CODE = "INVALID_INPUT";
    final String DOC_URL = "https://example.com/errors/invalid-input";
    final String REQUEST_ID = "abc123";

    RestClient client = mockClient(ERR_KEY, ERR_VALUE, ERR_MSG, HTTP_CODE, APP_CODE, CODE, DOC_URL, REQUEST_ID,
        protocolVersion, errorResponseHeaderName);
    Request<ErrorResponse> request = mockRequest(ErrorResponse.class, versionOption, contentType);
    RequestBuilder<Request<ErrorResponse>> requestBuilder = mockRequestBuilder(request);

    ResponseFuture<ErrorResponse> future = sendRequest(sendRequestOption,
                                                       determineErrorHandlingBehavior(getResponseOption),
                                                       client,
                                                       request,
                                                       requestBuilder);
    Response<ErrorResponse> response = getOkResponse(getResponseOption, future, timeoutOption);
    ErrorResponse e = response.getEntity();

    Assert.assertNull(response.getError());
    Assert.assertFalse(response.hasError());
    Assert.assertEquals(HTTP_CODE, response.getStatus());
    Assert.assertEquals(ERR_VALUE, e.getErrorDetails().data().getString(ERR_KEY));
    Assert.assertEquals(APP_CODE, e.getServiceErrorCode().intValue());
    Assert.assertEquals(ERR_MSG, e.getMessage());
    Assert.assertEquals(CODE, e.getCode());
    Assert.assertEquals(DOC_URL, e.getDocUrl());
    Assert.assertEquals(REQUEST_ID, e.getRequestId());
    Assert.assertEquals(EmptyRecord.class.getCanonicalName(), e.getErrorDetailType());
  }