use of io.confluent.ksql.execution.streams.materialization.WindowedRow in project ksql by confluentinc.
the class KsMaterializedSessionTableTest method shouldReturnValueIfSessionStartsBetweenBounds.
@Test
public void shouldReturnValueIfSessionStartsBetweenBounds() {
// Given:
final Instant wend = UPPER_INSTANT.plusMillis(5);
givenSingleSession(LOWER_INSTANT.plusMillis(1), wend);
// When:
final Iterator<WindowedRow> rowIterator = table.get(A_KEY, PARTITION, WINDOW_START_BOUNDS, Range.all()).rowIterator;
// Then:
assertThat(rowIterator.next(), is(WindowedRow.of(SCHEMA, sessionKey(LOWER_INSTANT.plusMillis(1), wend), A_VALUE, wend.toEpochMilli())));
}
use of io.confluent.ksql.execution.streams.materialization.WindowedRow in project ksql by confluentinc.
the class KsMaterializedSessionTableTest method shouldReturnValueIfSessionEndsAtLowerBoundIfLowerStartBoundClosed.
@Test
public void shouldReturnValueIfSessionEndsAtLowerBoundIfLowerStartBoundClosed() {
// Given:
final Range<Instant> endBounds = Range.closed(LOWER_INSTANT, UPPER_INSTANT);
final Instant wstart = LOWER_INSTANT.minusMillis(1);
givenSingleSession(wstart, LOWER_INSTANT);
// When:
final Iterator<WindowedRow> rowIterator = table.get(A_KEY, PARTITION, Range.all(), endBounds).rowIterator;
// Then:
assertThat(rowIterator.next(), is(WindowedRow.of(SCHEMA, sessionKey(wstart, LOWER_INSTANT), A_VALUE, LOWER_INSTANT.toEpochMilli())));
}
Aggregations