hailin0 commented on code in PR #3473:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3473#discussion_r1028778876


##########
seatunnel-connectors-v2/connector-http/connector-http-jira/src/main/java/org/apache/seatunnel/connectors/seatunnel/jira/source/JiraSource.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.seatunnel.connectors.seatunnel.jira.source;
+
+import static 
org.apache.seatunnel.connectors.seatunnel.http.util.AuthorizationUtil.getTokenByBasicAuth;
+
+import org.apache.seatunnel.api.common.PrepareFailException;
+import org.apache.seatunnel.api.source.SeaTunnelSource;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.common.config.CheckConfigUtil;
+import org.apache.seatunnel.common.config.CheckResult;
+import org.apache.seatunnel.common.constants.PluginType;
+import 
org.apache.seatunnel.connectors.seatunnel.common.source.AbstractSingleSplitReader;
+import 
org.apache.seatunnel.connectors.seatunnel.common.source.SingleSplitReaderContext;
+import org.apache.seatunnel.connectors.seatunnel.http.source.HttpSource;
+import org.apache.seatunnel.connectors.seatunnel.http.source.HttpSourceReader;
+import 
org.apache.seatunnel.connectors.seatunnel.jira.source.config.JiraSourceConfig;
+import 
org.apache.seatunnel.connectors.seatunnel.jira.source.config.JiraSourceParameter;
+
+import org.apache.seatunnel.shade.com.typesafe.config.Config;
+
+import com.google.auto.service.AutoService;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+@AutoService(SeaTunnelSource.class)
+public class JiraSource extends HttpSource {

Review Comment:
   Add method?
   
   ```java
       @Override
       public Boundedness getBoundedness() {
           if (JobMode.BATCH.equals(jobContext.getJobMode())) {
               return Boundedness.BOUNDED;
           }
           throw new UnsupportedOperationException(xxx);
       }
   ```



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/java/org/apache/seatunnel/e2e/connector/http/HttpJiraIT.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * 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.seatunnel.e2e.connector.http;
+
+import org.apache.seatunnel.e2e.common.TestResource;
+import org.apache.seatunnel.e2e.common.TestSuiteBase;
+import org.apache.seatunnel.e2e.common.container.TestContainer;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.TestTemplate;
+import org.testcontainers.containers.Container;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
+import org.testcontainers.lifecycle.Startables;
+import org.testcontainers.utility.DockerImageName;
+import org.testcontainers.utility.DockerLoggerFactory;
+import org.testcontainers.utility.MountableFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.stream.Stream;
+
+public class HttpJiraIT extends TestSuiteBase implements TestResource {
+
+    private static final String IMAGE = "mockserver/mockserver:5.14.0";
+
+    private GenericContainer<?> mockserverContainer;
+
+    @BeforeAll
+    @Override
+    public void startUp() {
+        this.mockserverContainer = new 
GenericContainer<>(DockerImageName.parse(IMAGE))
+                .withNetwork(NETWORK)
+                .withNetworkAliases("mockserver")
+                .withExposedPorts(1080)
+                .withCopyFileToContainer(MountableFile.forHostPath(new 
File(HttpIT.class.getResource(
+                                
"/mockserver-lemlist-config.json").getPath()).getAbsolutePath()),
+                        "/tmp/mockserver-lemlist-config.json")
+                .withEnv("MOCKSERVER_INITIALIZATION_JSON_PATH", 
"/tmp/mockserver-lemlist-config.json")
+                .withLogConsumer(new 
Slf4jLogConsumer(DockerLoggerFactory.getLogger(IMAGE)))
+                .waitingFor(new 
HttpWaitStrategy().forPath("/").forStatusCode(404));
+        Startables.deepStart(Stream.of(mockserverContainer)).join();
+    }
+
+    @AfterAll
+    @Override
+    public void tearDown() {
+        if (mockserverContainer != null) {
+            mockserverContainer.stop();
+        }
+    }
+
+    @TestTemplate
+    public void testHttpLemlistSourceToAssertSink(TestContainer container) 
throws IOException, InterruptedException {

Review Comment:
   ```suggestion
       public void testHttpJiraSourceToAssertSink(TestContainer container) 
throws IOException, InterruptedException {
   ```



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/java/org/apache/seatunnel/e2e/connector/http/HttpJiraIT.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * 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.seatunnel.e2e.connector.http;
+
+import org.apache.seatunnel.e2e.common.TestResource;
+import org.apache.seatunnel.e2e.common.TestSuiteBase;
+import org.apache.seatunnel.e2e.common.container.TestContainer;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.TestTemplate;
+import org.testcontainers.containers.Container;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
+import org.testcontainers.lifecycle.Startables;
+import org.testcontainers.utility.DockerImageName;
+import org.testcontainers.utility.DockerLoggerFactory;
+import org.testcontainers.utility.MountableFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.stream.Stream;
+
+public class HttpJiraIT extends TestSuiteBase implements TestResource {
+
+    private static final String IMAGE = "mockserver/mockserver:5.14.0";
+
+    private GenericContainer<?> mockserverContainer;
+
+    @BeforeAll
+    @Override
+    public void startUp() {
+        this.mockserverContainer = new 
GenericContainer<>(DockerImageName.parse(IMAGE))
+                .withNetwork(NETWORK)
+                .withNetworkAliases("mockserver")
+                .withExposedPorts(1080)
+                .withCopyFileToContainer(MountableFile.forHostPath(new 
File(HttpIT.class.getResource(
+                                
"/mockserver-lemlist-config.json").getPath()).getAbsolutePath()),
+                        "/tmp/mockserver-lemlist-config.json")
+                .withEnv("MOCKSERVER_INITIALIZATION_JSON_PATH", 
"/tmp/mockserver-lemlist-config.json")
+                .withLogConsumer(new 
Slf4jLogConsumer(DockerLoggerFactory.getLogger(IMAGE)))
+                .waitingFor(new 
HttpWaitStrategy().forPath("/").forStatusCode(404));
+        Startables.deepStart(Stream.of(mockserverContainer)).join();
+    }
+
+    @AfterAll
+    @Override
+    public void tearDown() {
+        if (mockserverContainer != null) {
+            mockserverContainer.stop();
+        }
+    }
+
+    @TestTemplate
+    public void testHttpLemlistSourceToAssertSink(TestContainer container) 
throws IOException, InterruptedException {
+        Container.ExecResult execResult = 
container.executeJob("/lemlist_json_to_assert.conf");

Review Comment:
   ```suggestion
           Container.ExecResult execResult = 
container.executeJob("/jira_json_to_assert.conf");
   ```



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/java/org/apache/seatunnel/e2e/connector/http/HttpJiraIT.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * 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.seatunnel.e2e.connector.http;
+
+import org.apache.seatunnel.e2e.common.TestResource;
+import org.apache.seatunnel.e2e.common.TestSuiteBase;
+import org.apache.seatunnel.e2e.common.container.TestContainer;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.TestTemplate;
+import org.testcontainers.containers.Container;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
+import org.testcontainers.lifecycle.Startables;
+import org.testcontainers.utility.DockerImageName;
+import org.testcontainers.utility.DockerLoggerFactory;
+import org.testcontainers.utility.MountableFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.stream.Stream;
+
+public class HttpJiraIT extends TestSuiteBase implements TestResource {
+
+    private static final String IMAGE = "mockserver/mockserver:5.14.0";
+
+    private GenericContainer<?> mockserverContainer;
+
+    @BeforeAll
+    @Override
+    public void startUp() {
+        this.mockserverContainer = new 
GenericContainer<>(DockerImageName.parse(IMAGE))
+                .withNetwork(NETWORK)
+                .withNetworkAliases("mockserver")
+                .withExposedPorts(1080)
+                .withCopyFileToContainer(MountableFile.forHostPath(new 
File(HttpIT.class.getResource(
+                                
"/mockserver-lemlist-config.json").getPath()).getAbsolutePath()),
+                        "/tmp/mockserver-lemlist-config.json")
+                .withEnv("MOCKSERVER_INITIALIZATION_JSON_PATH", 
"/tmp/mockserver-lemlist-config.json")

Review Comment:
   ```suggestion
                   .withCopyFileToContainer(MountableFile.forHostPath(new 
File(HttpJiraIT.class.getResource(
                                   
"/mockserver-jira-config.json").getPath()).getAbsolutePath()),
                           "/tmp/mockserver-jira-config.json")
                   .withEnv("MOCKSERVER_INITIALIZATION_JSON_PATH", 
"/tmp/mockserver-jira-config.json")
   ```



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