use of com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable in project java-bigtable by googleapis.
the class FilterMarkerRowsCallableTest method testRealRow.
@Test
public void testRealRow() {
Row row = buildRealRow();
ServerStreamingStashCallable<ReadRowsRequest, Row> innerCallable = new ServerStreamingStashCallable<>(Lists.newArrayList(row));
FilterMarkerRowsCallable<Row> filterCallable = new FilterMarkerRowsCallable<>(innerCallable, rowAdapter);
ServerStream<Row> results = filterCallable.call(ReadRowsRequest.getDefaultInstance());
assertThat(results).containsExactly(row);
}
use of com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable in project java-bigtable by googleapis.
the class FilterMarkerRowsCallableTest method testMixed.
@Test
public void testMixed() {
Row row = buildRealRow();
Row markerRow = buildScanMarker();
ServerStreamingStashCallable<ReadRowsRequest, Row> innerCallable = new ServerStreamingStashCallable<>(Lists.newArrayList(row, markerRow));
FilterMarkerRowsCallable<Row> filterCallable = new FilterMarkerRowsCallable<>(innerCallable, rowAdapter);
ServerStream<Row> results = filterCallable.call(ReadRowsRequest.getDefaultInstance());
assertThat(results).containsExactly(row);
}
use of com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable in project java-bigtable by googleapis.
the class ReadRowsUserCallableTest method testFirstIsLimited.
@Test
public void testFirstIsLimited() {
ServerStreamingStashCallable<ReadRowsRequest, Row> innerCallable = new ServerStreamingStashCallable<>();
ReadRowsUserCallable<Row> callable = new ReadRowsUserCallable<>(innerCallable, REQUEST_CONTEXT);
Query query = Query.create("fake-table");
callable.first().call(query);
Truth.assertThat(innerCallable.getActualRequest()).isEqualTo(query.limit(1).toProto(REQUEST_CONTEXT));
}
Aggregations