alpreu commented on a change in pull request #18033:
URL: https://github.com/apache/flink/pull/18033#discussion_r779415488
##########
File path:
flink-connectors/flink-connector-elasticsearch-base/src/test/java/org/apache/flink/connector/elasticsearch/table/ElasticsearchDynamicSinkFactoryBaseTest.java
##########
@@ -227,4 +234,19 @@ public void validateWrongCredential() {
"")
.build()));
}
+
+ @Test
+ public void testSinkParallelism() {
+ ElasticsearchDynamicSinkFactoryBase sinkFactory = createSinkFactory();
+ DynamicTableSink sink =
+ sinkFactory.createDynamicTableSink(
+ createPrefilledTestContext()
+ .withOption(SINK_PARALLELISM.key(), "2")
+ .build());
+ assertTrue(sink instanceof ElasticsearchDynamicSink);
+ ElasticsearchDynamicSink esSink = (ElasticsearchDynamicSink) sink;
+ SinkProvider provider =
+ (SinkProvider) esSink.getSinkRuntimeProvider(new
SinkRuntimeProviderContext(false));
Review comment:
Instead of using `SinkRuntimeProviderContext` we could move
`MockContext` from `ElasticsearchDynamicSinkBase` to `ElasticsearchUtils` and
use that one instead. In this case we don't need to add `flink-table-planner`
as a dependency.
##########
File path:
flink-connectors/flink-connector-elasticsearch-base/src/test/java/org/apache/flink/connector/elasticsearch/table/ElasticsearchDynamicSinkFactoryBaseTest.java
##########
@@ -34,6 +37,10 @@
import java.util.Arrays;
import java.util.Collections;
+import static org.apache.flink.table.factories.FactoryUtil.SINK_PARALLELISM;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
Review comment:
Flink has switched over to using assertj for tests. Please use the
corresponding assertj assertions instead
--
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]