davidradl commented on code in PR #26917: URL: https://github.com/apache/flink/pull/26917#discussion_r2300463638
########## flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/StreamSourceOperatorWatermarksTest.java: ########## @@ -18,65 +18,84 @@ package org.apache.flink.streaming.runtime.operators; +import org.apache.flink.api.common.eventtime.Watermark; +import org.apache.flink.api.common.eventtime.WatermarkStrategy; import org.apache.flink.api.common.typeinfo.BasicTypeInfo; import org.apache.flink.api.common.typeinfo.TypeInformation; +import org.apache.flink.api.connector.source.ReaderOutput; +import org.apache.flink.api.connector.source.SourceReader; +import org.apache.flink.api.connector.source.SourceReaderContext; +import org.apache.flink.api.connector.source.SplitEnumerator; +import org.apache.flink.api.connector.source.SplitEnumeratorContext; +import org.apache.flink.core.io.InputStatus; import org.apache.flink.runtime.execution.CancelTaskException; import org.apache.flink.runtime.jobgraph.OperatorID; -import org.apache.flink.streaming.api.functions.source.legacy.RichSourceFunction; -import org.apache.flink.streaming.api.functions.source.legacy.SourceFunction; import org.apache.flink.streaming.api.graph.StreamConfig; -import org.apache.flink.streaming.api.operators.StreamSource; -import org.apache.flink.streaming.api.watermark.Watermark; -import org.apache.flink.streaming.runtime.tasks.SourceStreamTask; +import org.apache.flink.streaming.api.operators.SourceOperatorFactory; +import org.apache.flink.streaming.runtime.tasks.SourceOperatorStreamTask; import org.apache.flink.streaming.runtime.tasks.StreamTaskTestHarness; +import org.apache.flink.test.util.source.AbstractTestSource; +import org.apache.flink.test.util.source.TestSourceReader; +import org.apache.flink.test.util.source.TestSplit; +import org.apache.flink.test.util.source.TestSplitEnumerator; import org.apache.flink.util.ExceptionUtils; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -/** Tests for {@link StreamSource} operators. */ -@SuppressWarnings("serial") +/** Tests for Source V2 operators. */ class StreamSourceOperatorWatermarksTest { @Test void testEmitMaxWatermarkForFiniteSource() throws Exception { - StreamSource<String, ?> sourceOperator = new StreamSource<>(new FiniteSource<>()); + SourceOperatorFactory<String> factory = Review Comment: as the legacy source is still supported, I think it would be better to deprecate the legacy source tests and add the new ones rather that replacing the tests. I am worried that the legacy source tests might still pick up on breaking changes. If the legacy source code paths are tested else where that would be fine. -- 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