use of org.apache.kafka.streams.kstream.TimeWindows in project apache-kafka-on-k8s by banzaicloud.
the class TimeWindowTest method shouldReturnMatchedWindowsOrderedByTimestamp.
@Test
public void shouldReturnMatchedWindowsOrderedByTimestamp() {
final TimeWindows windows = TimeWindows.of(12L).advanceBy(5L);
final Map<Long, TimeWindow> matched = windows.windowsFor(21L);
final Long[] expected = matched.keySet().toArray(new Long[matched.size()]);
assertEquals(expected[0].longValue(), 10L);
assertEquals(expected[1].longValue(), 15L);
assertEquals(expected[2].longValue(), 20L);
}
Aggregations