@Test public void testAddFailure() { RuntimeException exception = new RuntimeException("can not perform mutation"); SettableApiFuture<Void> future = SettableApiFuture.create(); when(batcher.add(rowMutation)).thenReturn(future); future.setException(exception); try { bulkMutationWrapper.add(rowMutation).get(); fail("should throw an exception"); } catch (Exception actualException) { assertEquals(exception, actualException.getCause()); } verify(batcher).add(rowMutation); }
@Override public synchronized ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkNotNull(rowMutation, "mutation details cannot be null"); return bulkMutateBatcher.add(rowMutation); }
BulkMutationVeneerApi implements BulkMutationWrapper { @Override public synchronized ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkNotNull(rowMutation, "mutation details cannot be null"); return bulkMutateBatcher.add(rowMutation); } }
BulkMutationVeneerApi implements BulkMutationWrapper { @Override public synchronized ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkNotNull(rowMutation, "mutation details cannot be null"); return bulkMutateBatcher.add(rowMutation); } BulkMutationVeneerApi(Batcher<RowMutationEntry, Void> bulkMutateBatcher); }
BulkMutationVeneerApi implements BulkMutationWrapper { @Override public synchronized ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkNotNull(rowMutation, "mutation details cannot be null"); return bulkMutateBatcher.add(rowMutation); } BulkMutationVeneerApi(Batcher<RowMutationEntry, Void> bulkMutateBatcher); @Override synchronized ApiFuture<Void> add(RowMutationEntry rowMutation); @Override void sendUnsent(); @Override void flush(); @Override void close(); }
BulkMutationVeneerApi implements BulkMutationWrapper { @Override public synchronized ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkNotNull(rowMutation, "mutation details cannot be null"); return bulkMutateBatcher.add(rowMutation); } BulkMutationVeneerApi(Batcher<RowMutationEntry, Void> bulkMutateBatcher); @Override synchronized ApiFuture<Void> add(RowMutationEntry rowMutation); @Override void sendUnsent(); @Override void flush(); @Override void close();  }