BigtableDataGCJClient implements IBigtableDataClient, AutoCloseable { @Override public ResultScanner<Row> readRows(Query request) { final ServerStream<Row> response = delegate.readRows(request); return new RowResultScanner<>(response, new Row[0]); } BigtableDataGCJClient(BigtableDataClient delegate); @Override void mutateRow(RowMutation rowMutation); @Override ApiFuture<Void> mutateRowAsync(RowMutation rowMutation); @Override Row readModifyWriteRow(ReadModifyWriteRow readModifyWriteRow); @Override ApiFuture<Row> readModifyWriteRowAsync(ReadModifyWriteRow readModifyWriteRow); @Override IBulkMutation createBulkMutationBatcher(String tableId); @Override Boolean checkAndMutateRow(ConditionalRowMutation conditionalRowMutation); @Override ApiFuture<Boolean> checkAndMutateRowAsync(ConditionalRowMutation conditionalRowMutation); @Override List<KeyOffset> sampleRowKeys(String tableId); @Override ApiFuture<List<KeyOffset>> sampleRowKeysAsync(String tableId); @Override ResultScanner<Row> readRows(Query request); @Override ApiFuture<List<Row>> readRowsAsync(Query request); @Override List<FlatRow> readFlatRowsList(Query request); @Override ResultScanner<FlatRow> readFlatRows(Query request); @Override ApiFuture<List<FlatRow>> readFlatRowsAsync(Query request); @Override void readFlatRowsAsync(Query request, StreamObserver<FlatRow> observer); @Override void close();  }
@Test public void testReadRows() throws Exception { ServerStream<Row> stream = mock(ServerStream.class); when(dataClientV2.readRows(request)).thenReturn(stream); when(stream.iterator()).thenReturn(rows.iterator()); ResultScanner<Row> results = dataGCJClient.readRows(request); assertEquals(rows.get(0), results.next()); assertEquals(rows.get(1), results.next()); verify(dataClientV2).readRows(request); verify(stream).iterator(); }