@Override
  public Future<RestResponse> restRequest(RestRequest request)
  {
    return restRequest(request, new RequestContext());
  }
@Test(groups = {"small"}, dataProvider = "allCombinations3x")
  @SuppressWarnings("deprecation")
  public void testRequestTimeoutAllowed(boolean isHigherThanDefault, boolean ignoreTimeoutIfHigher, int expectedTimeout) throws Exception
  {
    LoadBalancerSimulator.ClockedExecutor clockedExecutor = new LoadBalancerSimulator.ClockedExecutor();

    LoadBalancerMock balancer = new LoadBalancerMock(false, true, clockedExecutor);
    DirectoryProvider dirProvider = new DirectoryProviderMock();
    KeyMapperProvider keyMapperProvider = new KeyMapperProviderMock();
    ClientFactoryProvider clientFactoryProvider = Mockito.mock(ClientFactoryProvider.class);
    Facilities facilities = new DelegatingFacilities(dirProvider, keyMapperProvider, clientFactoryProvider);
    D2Client client = new DynamicClient(balancer, facilities, true);
    URI uri = URI.create("d2://test");
    RestRequest restRequest = new RestRequestBuilder(uri).build();

    client = new RequestTimeoutClient(client, balancer, clockedExecutor);

    RequestContext requestContext = new RequestContext();

    int requestTimeout = isHigherThanDefault ? DEFAULT_REQUEST_TIMEOUT + 100 : DEFAULT_REQUEST_TIMEOUT - 100;

    DegraderTrackerClientTest.TestCallback<RestResponse> restCallback = new DegraderTrackerClientTest.TestCallback<>();
    requestContext.putLocalAttr(R2Constants.REQUEST_TIMEOUT, requestTimeout);
    if (ignoreTimeoutIfHigher)
    {
      requestContext.putLocalAttr(R2Constants.REQUEST_TIMEOUT_IGNORE_IF_HIGHER_THAN_DEFAULT, ignoreTimeoutIfHigher);
    }
    client.restRequest(restRequest, requestContext, restCallback);

    clockedExecutor.run(expectedTimeout - 10).get();
    Assert.assertFalse(checkTimeoutFired(restCallback));
    checkRequestTimeoutOrViewSet(requestContext);

    clockedExecutor.run(expectedTimeout + 10).get();
    Assert.assertTrue(checkTimeoutFired(restCallback));
    checkRequestTimeoutOrViewSet(requestContext);

  }