reswqa commented on code in PR #25452: URL: https://github.com/apache/flink/pull/25452#discussion_r1794735269
########## flink-tests/src/test/java/org/apache/flink/test/streaming/runtime/KeyedPartitionWindowedStreamITCase.java: ########## @@ -97,6 +101,42 @@ public void mapPartition( createExpectedString(3)); } + @Test + void testRichMapPartitionFunctionHasOpen() throws Exception { + StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); + DataStreamSource<Tuple2<String, String>> source = env.fromData(createSource()); + source.keyBy( + new KeySelector<Tuple2<String, String>, String>() { + @Override + public String getKey(Tuple2<String, String> value) throws Exception { + return value.f0; + } + }) + .fullWindowPartition() + .mapPartition( + new RichMapPartitionFunction<Tuple2<String, String>, String>() { + + private boolean isOpen = false; + + @Override + public void open(OpenContext openContext) throws Exception { + super.open(openContext); + isOpen = true; + } + + @Override + public void mapPartition( + Iterable<Tuple2<String, String>> values, Collector<String> out) + throws Exception { + Assertions.assertTrue( Review Comment: We shall use `AssertJ` instead of `JunitAssertion` `assertThat(isOpen).isTrue()` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org