@Test(expected = ExecutionException.class) public void testAddFailure() throws Exception { SettableApiFuture<Void> future = SettableApiFuture.create(); when(batcher.add(rowMutation)).thenReturn(future); future.setException(new RuntimeException("can not perform mutation")); ApiFuture<Void> result = bulkMutationClient.add(rowMutation); assertTrue(result.isDone()); verify(batcher).add(rowMutation); result.get(); }
@Override public synchronized ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkNotNull(rowMutation, "mutation details cannot be null"); return bulkMutateBatcher.add(rowMutation); }
BulkMutationGCJClient implements IBulkMutation { @Override public synchronized ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkNotNull(rowMutation, "mutation details cannot be null"); return bulkMutateBatcher.add(rowMutation); } }
BulkMutationGCJClient implements IBulkMutation { @Override public synchronized ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkNotNull(rowMutation, "mutation details cannot be null"); return bulkMutateBatcher.add(rowMutation); } BulkMutationGCJClient(Batcher<RowMutationEntry, Void> bulkMutateBatcher); }
BulkMutationGCJClient implements IBulkMutation { @Override public synchronized ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkNotNull(rowMutation, "mutation details cannot be null"); return bulkMutateBatcher.add(rowMutation); } BulkMutationGCJClient(Batcher<RowMutationEntry, Void> bulkMutateBatcher); @Override synchronized ApiFuture<Void> add(RowMutationEntry rowMutation); @Override void sendUnsent(); @Override void flush(); @Override void close(); }
BulkMutationGCJClient implements IBulkMutation { @Override public synchronized ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkNotNull(rowMutation, "mutation details cannot be null"); return bulkMutateBatcher.add(rowMutation); } BulkMutationGCJClient(Batcher<RowMutationEntry, Void> bulkMutateBatcher); @Override synchronized ApiFuture<Void> add(RowMutationEntry rowMutation); @Override void sendUnsent(); @Override void flush(); @Override void close();  }