@Override
  public void streamRequest(StreamRequest request, Callback<StreamResponse> callback)
  {
    streamRequest(request, new RequestContext(), callback);
  }
@Test(invocationCount = 3, dataProvider = "isD2Async")
  public void testStreamRequestWithIsFullRequest(boolean isD2Async) throws Exception {
    int responseDelayNano = 500000000; //5s till response comes back
    int backupDelayNano = 100000000; // make backup request after 1 second
    Deque<URI> hostsReceivingRequest = new ConcurrentLinkedDeque<>();
    BackupRequestsClient client =
        createAlwaysBackupClientWithHosts(Arrays.asList("http://test1.com:123", "http://test2.com:123"),
            hostsReceivingRequest, responseDelayNano, backupDelayNano, isD2Async);

    URI uri = URI.create("d2://testService");

    // if there is IS_FULL_REQUEST set, backup requests will happen
    StreamRequest streamRequest =
        new StreamRequestBuilder(uri).build(EntityStreams.newEntityStream(new ByteStringWriter(CONTENT)));
    RequestContext context = new RequestContext();
    context.putLocalAttr(R2Constants.OPERATION, "get");
    context.putLocalAttr(R2Constants.IS_FULL_REQUEST, true);
    RequestContext context1 = context.clone();

    CountDownLatch latch = new CountDownLatch(1);
    AtomicReference<AssertionError> failure = new AtomicReference<>();

    client.streamRequest(streamRequest, context1, new Callback<StreamResponse>() {
      @Override
      public void onError(Throwable e) {
        failure.set(new AssertionError("Callback onError"));
        latch.countDown();
      }

      @Override
      public void onSuccess(StreamResponse result) {
        try {
          assertEquals(result.getStatus(), 200);
          assertEquals(result.getHeader("buffered"), "true");
          assertEquals(hostsReceivingRequest.size(), 2);
          assertEquals(new HashSet<>(hostsReceivingRequest).size(), 2);
          hostsReceivingRequest.clear();
        } catch (AssertionError e) {
          failure.set(e);
        }
        latch.countDown();
      }
    });

    latch.await(6, TimeUnit.SECONDS);
    if (failure.get() != null) {
      throw failure.get();
    }
  }