use of com.google.api.gax.rpc.testing.FakeOperationApi.OperationStashCallable in project gax-java by googleapis.
the class OperationCallableImplTest method callCancel.
@Test
public void callCancel() throws Exception {
ApiCallContext defaultCallContext = FakeCallContext.createDefault();
OperationStashCallable stashCallable = new OperationStashCallable();
OperationCallable<Integer, String, Long> callable = stashCallable.withDefaultCallContext(defaultCallContext);
OperationFuture<String, Long> operationFuture = callable.futureCall(45);
callable.cancel(operationFuture.getName()).get();
Truth.assertThat(stashCallable.wasCancelCalled()).isTrue();
Truth.assertThat(stashCallable.getCancelContext()).isSameInstanceAs(defaultCallContext);
}
Aggregations