alpreu commented on a change in pull request #17538:
URL: https://github.com/apache/flink/pull/17538#discussion_r748287865
##########
File path:
flink-connectors/flink-connector-elasticsearch-base/src/test/java/org/apache/flink/connector/elasticsearch/sink/ElasticsearchSinkBuilderBaseTest.java
##########
@@ -19,27 +19,41 @@
import org.apache.flink.connector.base.DeliveryGuarantee;
import
org.apache.flink.connectors.test.common.junit.extensions.TestLoggerExtension;
-import org.apache.flink.shaded.guava30.com.google.common.collect.Lists;
+
import org.apache.http.HttpHost;
+import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestFactory;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.extension.ExtendWith;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.MethodSource;
-import java.util.List;
+import java.util.stream.Stream;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertThrows;
/** Tests for {@link ElasticsearchSinkBuilderBase}. */
@ExtendWith(TestLoggerExtension.class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
abstract class ElasticsearchSinkBuilderBaseTest<B extends
ElasticsearchSinkBuilderBase<Object, B>> {
- @ParameterizedTest
- @MethodSource("validBuilders")
- void testBuildElasticsearchSink(B builder) {
- builder.build();
+ @TestFactory
+ Stream<DynamicTest> testValidBuilders() {
+ Stream<B> validBuilders =
+ Stream.of(
+ createMinimalBuilder(),
+ createMinimalBuilder()
+
.setDeliveryGuarantee(DeliveryGuarantee.AT_LEAST_ONCE),
+ createMinimalBuilder()
+
.setBulkFlushBackoffStrategy(FlushBackoffType.CONSTANT, 1, 1),
+ createMinimalBuilder()
+ .setConnectionUsername("username")
+ .setConnectionPassword("password"));
+
+ return DynamicTest.stream(
+ validBuilders,
+ ElasticsearchSinkBuilderBase::toString,
Review comment:
As discussed offline, we keep the toString() as it shows all the
builders fields as the test description
--
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]