use of org.apache.flink.streaming.runtime.tasks.StreamTaskTestHarness in project flink by apache.
the class StreamIterationHeadTest method testIterationHeadWatermarkEmission.
@Test
public void testIterationHeadWatermarkEmission() throws Exception {
StreamIterationHead<Integer> head = new StreamIterationHead<>();
StreamTaskTestHarness<Integer> harness = new StreamTaskTestHarness<>(head, BasicTypeInfo.INT_TYPE_INFO);
harness.setupOutputForSingletonOperatorChain();
harness.getStreamConfig().setIterationId("1");
harness.getStreamConfig().setIterationWaitTime(1);
harness.invoke();
harness.waitForTaskCompletion();
assertEquals(1, harness.getOutput().size());
assertEquals(new Watermark(Long.MAX_VALUE), harness.getOutput().peek());
}
Aggregations