title: How to test Flink Global Window with Trigger And Evictor
body: <p>I have a pipeline which use Flink Global Window with custom Trigger based on Event Time (from timestamp on arriving element) and Evictor which cut unnecessary elements from the window and pass it to the ProcessFunction,</p>
  <p>something like:</p>
  <pre><code> public SingleOutputStreamOperator&lt;Results&gt; processElements(DataStream&lt;Elements&gt; inputStream) {
   return inputStream
                  .keyBy(Elements::getId)
                  .window(GlobalWindows.create())
                  .trigger(new CustomTrigger())
                  .evictor(new CustomEvictor())
                  .process(new MyWindowProcessFunction())
                  .name(&quot;Process&quot;)
                  .uid(&quot;process-elements&quot;)
                  .returns(Results.class);    
  }
  
      public void executePipelineFlow(StreamExecutionEnvironment env) throws Exception {
          DataStream&lt;Elements&gt; inputStream = getInputStream(env);
          DataStream&lt;Results&gt; processedInput = processElements(inputStream);
          applySink(processedInput);
  }
  
  </code></pre>
  <p>I know i can test MyWindowProcessFunction with TestHarness which provide Watermark manipulation but i need to test whole flow, Trigger+Evictor+ProcessFunction.</p>
  <p>Also i try some kind of timed SourceFunction with use of Thread.sleep() but my pipeline work in event time and this wont work if i had 1000 elements in test stream (because test will take couple of hours).</p>
  <p>My question is, how i can unit test my whole <code>processElements</code> method?</p>
  <p>I cant find any test examples for my case.</p>
  <p>Thanks</p>