@Test public void testOK() throws Exception { final ReadRowsResponse result = ReadRowsResponse.getDefaultInstance(); Answer<Void> answer = new Answer<Void>() { @Override public Void answer(InvocationOnMock invocation) { Listener listener = invocation.getArgument(1, ClientCall.Listener.class); listener.onMessage(result); listener.onClose(Status.OK, null); return null; } }; doAnswer(answer) .when(readAsync) .start( (ReadRowsRequest) any(), (ClientCall.Listener) any(), (Metadata) any(), (ClientCall) any()); ListenableFuture future = createOperation(CallOptions.DEFAULT).getAsyncResult(); Assert.assertEquals(result, future.get(1, TimeUnit.SECONDS)); verify(readAsync, times(1)) .start( (ReadRowsRequest) any(), (ClientCall.Listener) any(), (Metadata) any(), (ClientCall) any()); }
@Override public void onMessage(ResponseT message) { value = message; completionFuture.set(value); }
RetryingUnaryOperation extends AbstractRetryingOperation<RequestT, ResponseT, ResponseT> { @Override public void onMessage(ResponseT message) { value = message; completionFuture.set(value); } }
RetryingUnaryOperation extends AbstractRetryingOperation<RequestT, ResponseT, ResponseT> { @Override public void onMessage(ResponseT message) { value = message; completionFuture.set(value); } RetryingUnaryOperation(
      RetryOptions retryOptions,
      RequestT request,
      BigtableAsyncRpc<RequestT, ResponseT> retryableRpc,
      CallOptions callOptions,
      ScheduledExecutorService executorService,
      Metadata metadata,
      ApiClock clock); }
RetryingUnaryOperation extends AbstractRetryingOperation<RequestT, ResponseT, ResponseT> { @Override public void onMessage(ResponseT message) { value = message; completionFuture.set(value); } RetryingUnaryOperation(
      RetryOptions retryOptions,
      RequestT request,
      BigtableAsyncRpc<RequestT, ResponseT> retryableRpc,
      CallOptions callOptions,
      ScheduledExecutorService executorService,
      Metadata metadata,
      ApiClock clock); @Override void onMessage(ResponseT message); }
RetryingUnaryOperation extends AbstractRetryingOperation<RequestT, ResponseT, ResponseT> { @Override public void onMessage(ResponseT message) { value = message; completionFuture.set(value); } RetryingUnaryOperation(
      RetryOptions retryOptions,
      RequestT request,
      BigtableAsyncRpc<RequestT, ResponseT> retryableRpc,
      CallOptions callOptions,
      ScheduledExecutorService executorService,
      Metadata metadata,
      ApiClock clock); @Override void onMessage(ResponseT message);  }