use of org.apache.kafka.streams.query.WindowKeyQuery in project ksql by confluentinc.
the class KsMaterializedWindowTableIQv2Test method shouldSupportRangeAll.
@Test
public void shouldSupportRangeAll() {
// When:
final StateQueryResult partitionResult = new StateQueryResult();
final QueryResult result = QueryResult.forResult(fetchIterator);
result.setPosition(POSITION);
partitionResult.addResult(PARTITION, result);
when(kafkaStreams.query(any())).thenReturn(partitionResult);
table.get(A_KEY, PARTITION, Range.all(), Range.all());
// Then:
verify(kafkaStreams).query(queryTypeCaptor.capture());
StateQueryRequest request = queryTypeCaptor.getValue();
assertThat(request.getQuery(), instanceOf(WindowKeyQuery.class));
WindowKeyQuery keyQuery = (WindowKeyQuery) request.getQuery();
assertThat(keyQuery.getKey(), is(A_KEY));
}
Aggregations