AsyncRemoteTable implements AsyncReadWriteTable<K, V> { @Override public CompletableFuture<Void> putAllAsync(List<Entry<K, V>> entries, Object ... args) { Preconditions.checkNotNull(writeFn, "null writeFn"); return args.length > 0 ? writeFn.putAllAsync(entries, args) : writeFn.putAllAsync(entries); } AsyncRemoteTable(TableReadFunction<K, V> readFn, TableWriteFunction<K, V> writeFn); @Override CompletableFuture<V> getAsync(K key, Object ... args); @Override CompletableFuture<Map<K, V>> getAllAsync(List<K> keys, Object ... args); @Override CompletableFuture<T> readAsync(int opId, Object... args); @Override CompletableFuture<Void> putAsync(K key, V record, Object... args); @Override CompletableFuture<Void> putAllAsync(List<Entry<K, V>> entries, Object ... args); @Override CompletableFuture<Void> deleteAsync(K key, Object... args); @Override CompletableFuture<Void> deleteAllAsync(List<K> keys, Object ... args); @Override CompletableFuture<T> writeAsync(int opId, Object... args); @Override void init(Context context); @Override void flush(); @Override void close();  }
@Test public void testPutAllAsync() { verifyFailure(() -> roTable.putAllAsync(Arrays.asList(new Entry(1, 2)))); rwTable.putAllAsync(Arrays.asList(new Entry(1, 2))); verify(writeFn, times(1)).putAllAsync(any()); }
@Test public void testPutAllAsyncWithArgs() { verifyFailure(() -> roTable.putAllAsync(Arrays.asList(new Entry(1, 2)), Arrays.asList(0, 0))); rwTable.putAllAsync(Arrays.asList(new Entry(1, 2)), Arrays.asList(0, 0)); verify(writeFn, times(1)).putAllAsync(any(), any()); }