fapaul commented on a change in pull request #16796:
URL: https://github.com/apache/flink/pull/16796#discussion_r688388500
##########
File path:
flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/table/UpsertKafkaDynamicTableFactoryTest.java
##########
@@ -231,10 +238,27 @@ public void testBufferedTableSink() {
// Test kafka producer.
DynamicTableSink.SinkRuntimeProvider provider =
actualUpsertKafkaSink.getSinkRuntimeProvider(new
SinkRuntimeProviderContext(false));
- assertThat(provider, instanceOf(SinkFunctionProvider.class));
- final SinkFunctionProvider sinkFunctionProvider =
(SinkFunctionProvider) provider;
- final SinkFunction<RowData> sinkFunction =
sinkFunctionProvider.createSinkFunction();
- assertThat(sinkFunction, instanceOf(BufferedUpsertSinkFunction.class));
+ assertThat(provider, instanceOf(DataStreamSinkProvider.class));
+ final DataStreamSinkProvider sinkProvider = (DataStreamSinkProvider)
provider;
+ final DataStreamSink<?> sinkFunction =
+ sinkProvider.consumeDataStream(
+ new DataStream<>(
+ new LocalStreamEnvironment(),
+ new Transformation<RowData>("test", null, 1) {
+ @Override
+ public List<Transformation<?>>
getTransitivePredecessors() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public List<Transformation<?>> getInputs()
{
+ return Collections.emptyList();
+ }
+ }));
+ final Field field =
sinkFunction.getClass().getDeclaredField("transformation");
+ field.setAccessible(true);
+ final SinkTransformation transformation = (SinkTransformation)
field.get(sinkFunction);
+ assertThat(transformation.getSink(),
instanceOf(BufferedUpsertSink.class));
Review comment:
I 100% agree that the current setup is not _ideal_ but afaict we can
either use reflection or remove the test completely.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]