I'm using a KafkaSink to sink the results to kafka like .sinkTo(kafkaSink). I'm trying to come up with an end to end integration test and want to use a simple sink for the same. I came across CollectSink where I can add results to a list and do the matchers. But, CollectSink being SinkFunction, I am not able to use it in .sinkTo, instead addSink is where it can be used.
I have tried PrintSink but I want to read the saved data again to do some matchers.
Can anyone help me on how I can add a test sink so that it can be used along with .sinkTo?
Thank you in advance