title: How to properly test a Flink window function?
body: <p>Does anyone know how to test windowing functions in <code>Flink</code>? I am using the dependency <code>flink-test-utils_2.11</code>.</p>
  
  <p>My steps are:</p>
  
  <ol>
  <li>Get the <code>StreamExecutionEnvironment</code></li>
  <li>Create objects and add to the invironment</li>
  <li>Do a <code>keyBy</code></li>
  <li>add a Session Window</li>
  <li>execute an aggregate function</li>
  </ol>
  
  <pre><code>public class AggregateVariantCEVTest extends AbstractTestBase {
  
     @Test
      public void testAggregateVariantCev() throws Exception  {
         StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
         env.setParallelism(1);
  
         env.fromElements(objectOne, objectTwo)
                 .keyBy(new KeyedByMyCustomKey())
                 .window(EventTimeSessionWindows.withGap(Time.seconds(1)))
                 .aggregate(new MyAgreggateFunction());
  
  
         JobExecutionResult result = env.execute();
  
         assertEquals(myExpectedResults, result.getAllAccumulatorResults());
  
     }
  }
  </code></pre>
  
  <p>The problem is that <code>result.getAllAccumulatorResults()</code> size is 0. </p>
  
  <p>Any ideas what I am doing wrong? Thanks in advance!</p>