OperationCallableImpl extends OperationCallable<RequestT, ResponseT, MetadataT> { @Override public OperationFuture<ResponseT, MetadataT> resumeFutureCall( String operationName, ApiCallContext callContext) { ApiFuture<OperationSnapshot> firstAttempt = longRunningClient.getOperationCallable().futureCall(operationName, callContext); return futureCall(firstAttempt, callContext); } OperationCallableImpl(
      UnaryCallable<RequestT, OperationSnapshot> initialCallable,
      RetryingExecutorWithContext<OperationSnapshot> executor,
      LongRunningClient longRunningClient,
      OperationCallSettings<RequestT, ResponseT, MetadataT> operationCallSettings); @Override OperationFuture<ResponseT, MetadataT> futureCall(
      RequestT request, ApiCallContext callContext); @Override OperationFuture<ResponseT, MetadataT> resumeFutureCall(
      String operationName, ApiCallContext callContext); @Override ApiFuture<Void> cancel(String operationName, ApiCallContext callContext);  }
@Test public void testResumeFutureCall() throws Exception { String opName = "testResumeFutureCall"; Color resp = getColor(0.5f); Currency meta = Currency.getInstance("UAH"); OperationSnapshot resultOperation = getOperation(opName, resp, null, meta, true); LongRunningClient longRunningClient = mockGetOperation(StatusCode.Code.OK, resultOperation); ClientContext mockContext = getClientContext(new FakeChannel(), executor); OperationCallable<Integer, Color, Currency> callable = FakeCallableFactory.createOperationCallable( getUnexpectedStartCallable(), callSettings, mockContext, longRunningClient); OperationFuture<Color, Currency> future = callable.resumeFutureCall(opName); assertFutureSuccessMetaSuccess(opName, future, resp, meta); assertThat(executor.getIterationsCount()).isEqualTo(0); }