@Test
public void testFutureCallContextPropagation() throws Exception {

  String opName = "testFutureCallContextPropagation";
  Color resp = getColor(0.5f);
  Currency meta1 = Currency.getInstance("UAH");
  Currency meta2 = Currency.getInstance("USD");
  OperationSnapshot initialOperation = getOperation(opName, null, null, null, false);
  OperationSnapshot resultOperation = getOperation(opName, resp, null, meta2, true);
  UnaryCallable<Integer, OperationSnapshot> initialCallable =
      mockGetOpSnapshotCallable(StatusCode.Code.OK, initialOperation);
  LongRunningClient longRunningClient = Mockito.mock(LongRunningClient.class);
  @SuppressWarnings("unchecked")
  UnaryCallable<String, OperationSnapshot> getOpCallable = Mockito.mock(UnaryCallable.class);
  ArgumentCaptor<ApiCallContext> callContextCaptor =
      ArgumentCaptor.forClass(ApiCallContext.class);
  Mockito.when(longRunningClient.getOperationCallable()).thenReturn(getOpCallable);
  Mockito.when(getOpCallable.futureCall(Mockito.<String>any(), callContextCaptor.capture()))
      .thenReturn(ApiFutures.immediateFuture(resultOperation));
  OperationCallable<Integer, Color, Currency> callable =
      FakeCallableFactory.createOperationCallable(
          initialCallable, callSettings, initialContext, longRunningClient);
  ApiCallContext callContext = FakeCallContext.createDefault().withTimeout(Duration.ofMillis(10));
  callable.futureCall(2, callContext).get(10, TimeUnit.SECONDS);
  assertThat(callContextCaptor.getValue().getTimeout()).isEqualTo(Duration.ofMillis(10));
}