Hi,
I have test code (
https://github.com/nielsbasjes/yauaa/blob/v5.15/udfs/flink/src/test/java/nl/basjes/parse/useragent/flink/TestUserAgentAnalysisMapperInline.java#L140
)
that writes a DataStream to a List<> using LocalCollectionOutputFormat to
verify if the pipeline did what it should do.
List<TestRecord> result = new ArrayList<>(5);
testRecordDataSet
.writeUsingOutputFormat(new LocalCollectionOutputFormat<>(result));
environment.execute();
assertEquals(2, result.size());
I was just now upgrading to Flink 1.10 and I found that
apparently writeUsingOutputFormat has now been deprecated.
The comment says (
https://github.com/apache/flink/blob/release-1.10.0/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L1066
):
* @deprecated Please use the {@link
org.apache.flink.streaming.api.functions.sink.filesystem.StreamingFileSink}
explicitly using the
* {@link #addSink(SinkFunction)} method.
I'm not writing to a file at all. Looking at the API this
StreamingFileSink does not seem to fit what I'm doing.
What is in Flink 1.10 the correct way of writing a test to verify if the
output of my test run is valid?
--
Best regards / Met vriendelijke groeten,
Niels Basjes