Search in sources :

Example 6 with TimeWindow

use of org.apache.kafka.streams.kstream.internals.TimeWindow in project kafka by apache.

the class TimeWindowsTest method shouldComputeWindowsForTumblingWindows.

@Test
public void shouldComputeWindowsForTumblingWindows() {
    TimeWindows windows = TimeWindows.of(12L);
    Map<Long, TimeWindow> matched = windows.windowsFor(21L);
    assertEquals(1, matched.size());
    assertEquals(new TimeWindow(12L, 24L), matched.get(12L));
}
Also used : TimeWindow(org.apache.kafka.streams.kstream.internals.TimeWindow) Test(org.junit.Test)

Aggregations

TimeWindow (org.apache.kafka.streams.kstream.internals.TimeWindow)6 Test (org.junit.Test)5 Windowed (org.apache.kafka.streams.kstream.Windowed)2 HashMap (java.util.HashMap)1