PatrickRen commented on code in PR #19856:
URL: https://github.com/apache/flink/pull/19856#discussion_r908016836


##########
flink-end-to-end-tests/flink-end-to-end-tests-aws-kinesis-streams/src/test/java/org/apache/flink/connector/kinesis/table/test/KinesisStreamsTableApiIT.java:
##########
@@ -91,17 +92,20 @@ public class KinesisStreamsTableApiIT {
                     .withNetwork(network)
                     .withNetworkAliases(INTER_CONTAINER_KINESALITE_ALIAS);
 
-    public static final FlinkContainers FLINK =
-            FlinkContainers.builder()
+    public static final TestcontainersSettings TESTCONTAINERS_SETTINGS =
+            TestcontainersSettings.builder()
                     .setEnvironmentVariable("AWS_CBOR_DISABLE", "1")
                     .setEnvironmentVariable(
                             "FLINK_ENV_JAVA_OPTS",
-                            
"-Dorg.apache.flink.kinesis-streams.shaded.com.amazonaws.sdk.disableCertChecking
 -Daws.cborEnabled=false")
-                    .setNetwork(network)
-                    .setLogger(LOGGER)
+                            
"-Dorg.apache.flink.kinesis-firehose.shaded.com.amazonaws.sdk.disableCertChecking
 -Daws.cborEnabled=false")

Review Comment:
   Is this change expected?



##########
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/container/FlinkTestContainersConfigurator.java:
##########
@@ -0,0 +1,182 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.tests.util.flink.container;
+
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.configuration.RestOptions;
+import org.apache.flink.configuration.TaskManagerOptions;
+
+import org.slf4j.Logger;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.images.builder.ImageFromDockerfile;
+import org.testcontainers.utility.DockerImageName;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+
+/** Orchestrates configuration of Flink containers within Testcontainers 
framework. */
+class FlinkTestContainersConfigurator {

Review Comment:
   What about `FlinkContainersConfigurator`?



##########
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/container/FlinkContainers.java:
##########
@@ -128,9 +128,37 @@ public class FlinkContainers implements BeforeAllCallback, 
AfterAllCallback {
     @Nullable private RestClusterClient<StandaloneClusterId> restClusterClient;
     private boolean isStarted = false;
 
+    // TODO: update Class JavaDocs when design is fixed
+    /** The FlinkContainers builder. */
+    public static final class Builder {
+        private FlinkContainersSettings flinkContainersSettings =
+                FlinkContainersSettings.defaultConfig();
+        private TestcontainersSettings testcontainersSettings =
+                TestcontainersSettings.defaultSettings();
+
+        private Builder() {}
+
+        public Builder withFlinkContainerSettings(FlinkContainersSettings 
flinkContainerSettings) {

Review Comment:
   It looks like the naming of methods and classes are not aligned 
(withFlink**Container**Settings vs. Flink**Containers**Settings / 
with**Testcontainer**Settings vs. **Testcontainers**Settings)



##########
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/container/TestcontainersSettings.java:
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.tests.util.flink.container;
+
+import org.slf4j.Logger;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.Network;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+/** The type Test containers settings. */
+public class TestcontainersSettings {
+
+    private Network network;
+    private Logger logger;
+    private String baseImage;
+    private Map<String, String> envVars;
+    private Collection<GenericContainer<?>> dependingContainers;
+
+    private TestcontainersSettings(Builder builder) {
+        network = builder.network;
+        baseImage = builder.baseImage;
+        logger = builder.logger;
+        envVars = builder.envVars;
+        dependingContainers = builder.dependingContainers;
+    }
+
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    public static TestcontainersSettings defaultSettings() {
+        return builder().build();
+    }
+
+    /** {@code TestContainersSettings} builder static inner class. */
+    public static final class Builder {
+        private Network network = Network.newNetwork();
+        private String baseImage;
+        private Logger logger;
+        private final Map<String, String> envVars = new HashMap<>();
+        private Collection<GenericContainer<?>> dependingContainers = new 
ArrayList<>();
+
+        private Builder() {}
+
+        /** Sets environment variable to containers. */
+        public Builder setEnvironmentVariable(String key, String value) {

Review Comment:
   What about using `environmentVariable` to align with other methods? 



-- 
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]

Reply via email to