AsyncRemoteTable implements AsyncReadWriteTable<K, V> { @Override public CompletableFuture<Void> putAsync(K key, V record, Object... args) { Preconditions.checkNotNull(writeFn, "null writeFn"); return args.length > 0 ? writeFn.putAsync(key, record, args) : writeFn.putAsync(key, record); } 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 testPutAsync() { verifyFailure(() -> roTable.putAsync(1, 2)); rwTable.putAsync(1, 2); verify(writeFn, times(1)).putAsync(any(), any()); }
@Test public void testPutAsyncWithArgs() { verifyFailure(() -> roTable.putAsync(1, 2, 3)); rwTable.putAsync(1, 2, 3); verify(writeFn, times(1)).putAsync(any(), any(), any()); }