@Test public void testAddMutate() { RowMutationEntry rowMutation = RowMutationEntry.create("key"); MutateRowsRequest.Entry requestProto = rowMutation.toProto(); when(mockDelegate.add(requestProto)) .thenReturn(Futures.immediateFuture(MutateRowResponse.getDefaultInstance())); Future<Void> response = bulkWrapper.add(rowMutation); try { response.get(); } catch (Exception ex) { throw new AssertionError("Assertion failed for BulkMutationWrapper#add(RowMutation)"); } 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; } }); }
BulkMutationWrapper implements IBulkMutation { @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; } }); } }
BulkMutationWrapper implements IBulkMutation { @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; } }); } BulkMutationWrapper(BulkMutation bulkMutation); }
BulkMutationWrapper implements IBulkMutation { @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; } }); } BulkMutationWrapper(BulkMutation bulkMutation); @Override ApiFuture<Void> add(RowMutationEntry rowMutation); @Override void sendUnsent(); @Override void flush(); @Override void close(); }
BulkMutationWrapper implements IBulkMutation { @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; } }); } BulkMutationWrapper(BulkMutation bulkMutation); @Override ApiFuture<Void> add(RowMutationEntry rowMutation); @Override void sendUnsent(); @Override void flush(); @Override void close();  }