Search in sources :

Example 1 with TimeWindows

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);
}
Also used : TimeWindows(org.apache.kafka.streams.kstream.TimeWindows) Test(org.junit.Test)

Aggregations

TimeWindows (org.apache.kafka.streams.kstream.TimeWindows)1 Test (org.junit.Test)1