@Test public void testAddMutate() throws ExecutionException, InterruptedException { RowMutationEntry rowMutation = RowMutationEntry.create("key"); MutateRowsRequest.Entry requestProto = rowMutation.toProto(); when(mockDelegate.add(requestProto)) .thenReturn(Futures.immediateFuture(MutateRowResponse.getDefaultInstance())); bulkMutationWrapper.add(rowMutation).get(); verify(mockDelegate).add(requestProto); }
@Override public ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkState(!isClosed, "can't mutate when the bulk mutation is closed."); return ApiFutureUtil.transformAndAdapt( delegate.add(rowMutation.toProto()), new Function<MutateRowResponse, Void>() { @Override public Void apply(MutateRowResponse response) { return null; } }); }
BulkMutationClassicApi implements BulkMutationWrapper { @Override public ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkState(!isClosed, "can't mutate when the bulk mutation is closed."); return ApiFutureUtil.transformAndAdapt( delegate.add(rowMutation.toProto()), new Function<MutateRowResponse, Void>() { @Override public Void apply(MutateRowResponse response) { return null; } }); } }
BulkMutationClassicApi implements BulkMutationWrapper { @Override public ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkState(!isClosed, "can't mutate when the bulk mutation is closed."); return ApiFutureUtil.transformAndAdapt( delegate.add(rowMutation.toProto()), new Function<MutateRowResponse, Void>() { @Override public Void apply(MutateRowResponse response) { return null; } }); } BulkMutationClassicApi(@Nonnull BulkMutation delegate); }
BulkMutationClassicApi implements BulkMutationWrapper { @Override public ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkState(!isClosed, "can't mutate when the bulk mutation is closed."); return ApiFutureUtil.transformAndAdapt( delegate.add(rowMutation.toProto()), new Function<MutateRowResponse, Void>() { @Override public Void apply(MutateRowResponse response) { return null; } }); } BulkMutationClassicApi(@Nonnull BulkMutation delegate); @Override ApiFuture<Void> add(RowMutationEntry rowMutation); @Override void sendUnsent(); @Override void flush(); @Override void close(); }
BulkMutationClassicApi implements BulkMutationWrapper { @Override public ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkState(!isClosed, "can't mutate when the bulk mutation is closed."); return ApiFutureUtil.transformAndAdapt( delegate.add(rowMutation.toProto()), new Function<MutateRowResponse, Void>() { @Override public Void apply(MutateRowResponse response) { return null; } }); } BulkMutationClassicApi(@Nonnull BulkMutation delegate); @Override ApiFuture<Void> add(RowMutationEntry rowMutation); @Override void sendUnsent(); @Override void flush(); @Override void close();  }