@Test
public void testReadFlatRowsAsync() throws Exception {

  UnaryCallable<Query, List<FlatRow>> unaryCallable = mock(UnaryCallable.class);
  when(dataClientV2.readRowsCallable(any(FlatRowAdapter.class))).thenReturn(serverStreaming);
  when(serverStreaming.all()).thenReturn(unaryCallable);
  when(unaryCallable.futureCall(request)).thenReturn(immediateFuture(flatRows));
  ApiFuture<List<FlatRow>> actualFlatRows = dataGCJClient.readFlatRowsAsync(request);
  assertEquals(flatRows, actualFlatRows.get());
  verify(dataClientV2).readRowsCallable(any(FlatRowAdapter.class));
  verify(serverStreaming).all();
  verify(unaryCallable).futureCall(request);
}