This is an automated email from the ASF dual-hosted git repository.

fanjia pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new 545595c6d [Feature][Connector V2] add gitlab source connector (#3408)
545595c6d is described below

commit 545595c6d2870d02af44925ba4d7e5beabfafc2e
Author: liugddx <[email protected]>
AuthorDate: Wed Nov 23 13:55:15 2022 +0800

    [Feature][Connector V2] add gitlab source connector (#3408)
    
    * add gitlab source
    
    * add gitlab source
    
    * add gitlab e2e test
    
    * fix e2e error
    
    * fix rv error.
    
    * fix ci error.
---
 docs/en/connector-v2/source/Gitlab.md              | 154 +++++++++++++++++++++
 plugin-mapping.properties                          |   1 +
 .../{ => connector-http-gitlab}/pom.xml            |  24 ++--
 .../seatunnel/gitlab/source/GitlabSource.java      |  74 ++++++++++
 .../gitlab/source/GitlabSourceFactory.java         |  44 ++++++
 .../gitlab/source/config/GitlabSourceConfig.java   |  32 +++++
 .../source/config/GitlabSourceParameter.java       |  35 +++++
 seatunnel-connectors-v2/connector-http/pom.xml     |   3 +-
 seatunnel-dist/pom.xml                             |   8 +-
 .../connector-http-e2e/pom.xml                     |   8 +-
 .../seatunnel/e2e/connector/http/HttpGitlabIT.java |  77 +++++++++++
 .../src/test/resources/gitlab_json_to_assert.conf  |  77 +++++++++++
 .../test/resources/mockserver-gitlab-config.json   |  22 +++
 13 files changed, 543 insertions(+), 16 deletions(-)

diff --git a/docs/en/connector-v2/source/Gitlab.md 
b/docs/en/connector-v2/source/Gitlab.md
new file mode 100644
index 000000000..f907a93ee
--- /dev/null
+++ b/docs/en/connector-v2/source/Gitlab.md
@@ -0,0 +1,154 @@
+# Gitlab
+
+> Gitlab source connector
+
+## Description
+
+Used to read data from Gitlab.
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [ ] [stream](../../concept/connector-v2-features.md)
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [x] [schema projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+
+##  Options
+
+| name                        | type   | required | default value |
+| --------------------------- | ------ | -------- | ------------- |
+| url                         | String | Yes      | -             |
+| access_token                | String | Yes      | -             |
+| method                      | String | No       | get           |
+| schema.fields               | Config | No       | -             |
+| format                      | String | No       | json          |
+| params                      | Map    | No       | -             |
+| body                        | String | No       | -             |
+| poll_interval_ms            | int    | No       | -             |
+| retry                       | int    | No       | -             |
+| retry_backoff_multiplier_ms | int    | No       | 100           |
+| retry_backoff_max_ms        | int    | No       | 10000         |
+| common-options              | config | No       | -             |
+
+### url [String]
+
+http request url
+
+### access_token [String]
+
+personal access token
+
+### method [String]
+
+http request method, only supports GET, POST method
+
+### params [Map]
+
+http params
+
+### body [String]
+
+http body
+
+### poll_interval_ms [int]
+
+request http api interval(millis) in stream mode
+
+### retry [int]
+
+The max retry times if request http return to `IOException`
+
+### retry_backoff_multiplier_ms [int]
+
+The retry-backoff times(millis) multiplier if request http failed
+
+### retry_backoff_max_ms [int]
+
+The maximum retry-backoff times(millis) if request http failed
+
+### format [String]
+
+the format of upstream data, now only support `json` `text`, default `json`.
+
+when you assign format is `json`, you should also assign schema option, for 
example:
+
+upstream data is the following:
+
+```json
+
+{"code":  200, "data":  "get success", "success":  true}
+
+```
+
+you should assign schema as the following:
+
+```hocon
+
+schema {
+    fields {
+        code = int
+        data = string
+        success = boolean
+    }
+}
+
+```
+
+connector will generate data as the following:
+
+| code | data        | success |
+|------|-------------|---------|
+| 200  | get success | true    |
+
+when you assign format is `text`, connector will do nothing for upstream data, 
for example:
+
+upstream data is the following:
+
+```json
+
+{"code":  200, "data":  "get success", "success":  true}
+
+```
+
+connector will generate data as the following:
+
+| content |
+|---------|
+| {"code":  200, "data":  "get success", "success":  true}        |
+
+### schema [Config]
+
+#### fields [Config]
+
+the schema fields of upstream data
+
+### common options 
+
+Source plugin common parameters, please refer to [Source Common 
Options](common-options.md) for details
+
+## Example
+
+```hocon
+Gitlab{
+    url = "https://gitlab.com/api/v4/projects";
+    access_token = "xxxxx"
+    schema {
+       fields {
+         id = int
+         description = string
+         name = string
+         name_with_namespace = string
+         path = string
+         http_url_to_repo = string
+       }
+    }
+}
+```
+
+## Changelog
+
+### next version
+
+- Add Gitlab Source Connector
diff --git a/plugin-mapping.properties b/plugin-mapping.properties
index 0100e8ffd..913c3fc6b 100644
--- a/plugin-mapping.properties
+++ b/plugin-mapping.properties
@@ -152,3 +152,4 @@ seatunnel.source.Lemlist = connector-http-lemlist
 seatunnel.source.Klaviyo = connector-http-klaviyo
 seatunnel.sink.Slack = connector-slack
 seatunnel.source.OneSignal = connector-http-onesignal
+seatunnel.source.Gitlab = connector-http-gitlab
diff --git a/seatunnel-connectors-v2/connector-http/pom.xml 
b/seatunnel-connectors-v2/connector-http/connector-http-gitlab/pom.xml
similarity index 70%
copy from seatunnel-connectors-v2/connector-http/pom.xml
copy to seatunnel-connectors-v2/connector-http/connector-http-gitlab/pom.xml
index a12dc508a..32e96e861 100644
--- a/seatunnel-connectors-v2/connector-http/pom.xml
+++ b/seatunnel-connectors-v2/connector-http/connector-http-gitlab/pom.xml
@@ -21,22 +21,20 @@
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
     <parent>
-        <artifactId>seatunnel-connectors-v2</artifactId>
+        <artifactId>connector-http</artifactId>
         <groupId>org.apache.seatunnel</groupId>
         <version>${revision}</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>connector-http</artifactId>
-    <packaging>pom</packaging>
 
-    <modules>
-        <module>connector-http-base</module>
-        <module>connector-http-feishu</module>
-        <module>connector-http-wechat</module>
-        <module>connector-http-myhours</module>
-        <module>connector-http-lemlist</module>
-        <module>connector-http-klaviyo</module>
-        <module>connector-http-onesignal</module>
-    </modules>
+    <artifactId>connector-http-gitlab</artifactId>
 
-</project>
\ No newline at end of file
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.seatunnel</groupId>
+            <artifactId>connector-http-base</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git 
a/seatunnel-connectors-v2/connector-http/connector-http-gitlab/src/main/java/org/apache/seatunnel/connectors/seatunnel/gitlab/source/GitlabSource.java
 
b/seatunnel-connectors-v2/connector-http/connector-http-gitlab/src/main/java/org/apache/seatunnel/connectors/seatunnel/gitlab/source/GitlabSource.java
new file mode 100644
index 000000000..4ca4f23a7
--- /dev/null
+++ 
b/seatunnel-connectors-v2/connector-http/connector-http-gitlab/src/main/java/org/apache/seatunnel/connectors/seatunnel/gitlab/source/GitlabSource.java
@@ -0,0 +1,74 @@
+/*
+ * 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.gitlab.source;
+
+import org.apache.seatunnel.api.common.PrepareFailException;
+import org.apache.seatunnel.api.source.Boundedness;
+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.JobMode;
+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.gitlab.source.config.GitlabSourceConfig;
+import 
org.apache.seatunnel.connectors.seatunnel.gitlab.source.config.GitlabSourceParameter;
+import org.apache.seatunnel.connectors.seatunnel.http.source.HttpSource;
+import org.apache.seatunnel.connectors.seatunnel.http.source.HttpSourceReader;
+
+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 GitlabSource extends HttpSource {
+    private final GitlabSourceParameter gitlabSourceParameter = new 
GitlabSourceParameter();
+
+    @Override
+    public String getPluginName() {
+        return "Gitlab";
+    }
+
+    @Override
+    public Boundedness getBoundedness() {
+        if (JobMode.BATCH.equals(jobContext.getJobMode())) {
+            return Boundedness.BOUNDED;
+        }
+        throw new UnsupportedOperationException("Gitlab source connector not 
support unbounded operation");
+    }
+
+    @Override
+    public void prepare(Config pluginConfig) throws PrepareFailException {
+        CheckResult result = CheckConfigUtil.checkAllExists(pluginConfig, 
GitlabSourceConfig.URL.key(),
+            GitlabSourceConfig.ACCESS_TOKEN.key());
+        if (!result.isSuccess()) {
+            throw new PrepareFailException(getPluginName(), PluginType.SOURCE, 
result.getMsg());
+        }
+        this.gitlabSourceParameter.buildWithConfig(pluginConfig);
+        buildSchemaWithConfig(pluginConfig);
+    }
+
+    @Override
+    public AbstractSingleSplitReader<SeaTunnelRow> 
createReader(SingleSplitReaderContext readerContext) throws Exception {
+        return new HttpSourceReader(this.gitlabSourceParameter, readerContext, 
this.deserializationSchema);
+    }
+
+}
diff --git 
a/seatunnel-connectors-v2/connector-http/connector-http-gitlab/src/main/java/org/apache/seatunnel/connectors/seatunnel/gitlab/source/GitlabSourceFactory.java
 
b/seatunnel-connectors-v2/connector-http/connector-http-gitlab/src/main/java/org/apache/seatunnel/connectors/seatunnel/gitlab/source/GitlabSourceFactory.java
new file mode 100644
index 000000000..af1ca91dd
--- /dev/null
+++ 
b/seatunnel-connectors-v2/connector-http/connector-http-gitlab/src/main/java/org/apache/seatunnel/connectors/seatunnel/gitlab/source/GitlabSourceFactory.java
@@ -0,0 +1,44 @@
+/*
+ * 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.gitlab.source;
+
+import org.apache.seatunnel.api.configuration.util.OptionRule;
+import org.apache.seatunnel.api.table.factory.Factory;
+import org.apache.seatunnel.api.table.factory.TableSourceFactory;
+import 
org.apache.seatunnel.connectors.seatunnel.gitlab.source.config.GitlabSourceConfig;
+
+import com.google.auto.service.AutoService;
+
+@AutoService(Factory.class)
+public class GitlabSourceFactory implements TableSourceFactory {
+    @Override
+    public String factoryIdentifier() {
+        return "Gitlab";
+    }
+
+    @Override
+    public OptionRule optionRule() {
+        return OptionRule.builder()
+            .required(GitlabSourceConfig.URL)
+            .required(GitlabSourceConfig.ACCESS_TOKEN)
+            .optional(GitlabSourceConfig.RETRY)
+            .optional(GitlabSourceConfig.RETRY_BACKOFF_MAX_MS)
+            .optional(GitlabSourceConfig.RETRY_BACKOFF_MULTIPLIER_MS)
+            .build();
+    }
+}
diff --git 
a/seatunnel-connectors-v2/connector-http/connector-http-gitlab/src/main/java/org/apache/seatunnel/connectors/seatunnel/gitlab/source/config/GitlabSourceConfig.java
 
b/seatunnel-connectors-v2/connector-http/connector-http-gitlab/src/main/java/org/apache/seatunnel/connectors/seatunnel/gitlab/source/config/GitlabSourceConfig.java
new file mode 100644
index 000000000..a161e8a03
--- /dev/null
+++ 
b/seatunnel-connectors-v2/connector-http/connector-http-gitlab/src/main/java/org/apache/seatunnel/connectors/seatunnel/gitlab/source/config/GitlabSourceConfig.java
@@ -0,0 +1,32 @@
+/*
+ * 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.gitlab.source.config;
+
+import org.apache.seatunnel.api.configuration.Option;
+import org.apache.seatunnel.api.configuration.Options;
+import org.apache.seatunnel.connectors.seatunnel.http.config.HttpConfig;
+
+public class GitlabSourceConfig extends HttpConfig {
+
+    public static final String PRIVATE_TOKEN = "PRIVATE-TOKEN";
+
+    public static final Option<String> ACCESS_TOKEN = 
Options.key("access_token")
+        .stringType()
+        .noDefaultValue()
+        .withDescription("Gitlab access_token");
+}
diff --git 
a/seatunnel-connectors-v2/connector-http/connector-http-gitlab/src/main/java/org/apache/seatunnel/connectors/seatunnel/gitlab/source/config/GitlabSourceParameter.java
 
b/seatunnel-connectors-v2/connector-http/connector-http-gitlab/src/main/java/org/apache/seatunnel/connectors/seatunnel/gitlab/source/config/GitlabSourceParameter.java
new file mode 100644
index 000000000..7f8e41e3f
--- /dev/null
+++ 
b/seatunnel-connectors-v2/connector-http/connector-http-gitlab/src/main/java/org/apache/seatunnel/connectors/seatunnel/gitlab/source/config/GitlabSourceParameter.java
@@ -0,0 +1,35 @@
+/*
+ * 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.gitlab.source.config;
+
+import org.apache.seatunnel.connectors.seatunnel.http.config.HttpParameter;
+
+import org.apache.seatunnel.shade.com.typesafe.config.Config;
+
+import java.util.HashMap;
+
+public class GitlabSourceParameter extends HttpParameter {
+
+    @Override
+    public void buildWithConfig(Config pluginConfig) {
+        super.buildWithConfig(pluginConfig);
+        this.headers = this.getHeaders() == null ? new HashMap<>() : 
this.getHeaders();
+        this.headers.put(GitlabSourceConfig.PRIVATE_TOKEN, 
pluginConfig.getString(GitlabSourceConfig.ACCESS_TOKEN.key()));
+        this.setHeaders(this.headers);
+    }
+}
diff --git a/seatunnel-connectors-v2/connector-http/pom.xml 
b/seatunnel-connectors-v2/connector-http/pom.xml
index a12dc508a..e0de4766c 100644
--- a/seatunnel-connectors-v2/connector-http/pom.xml
+++ b/seatunnel-connectors-v2/connector-http/pom.xml
@@ -37,6 +37,7 @@
         <module>connector-http-lemlist</module>
         <module>connector-http-klaviyo</module>
         <module>connector-http-onesignal</module>
+        <module>connector-http-gitlab</module>
     </modules>
 
-</project>
\ No newline at end of file
+</project>
diff --git a/seatunnel-dist/pom.xml b/seatunnel-dist/pom.xml
index c005860e4..8aad7aad0 100644
--- a/seatunnel-dist/pom.xml
+++ b/seatunnel-dist/pom.xml
@@ -357,6 +357,12 @@
                     <version>${project.version}</version>
                     <scope>provided</scope>
                 </dependency>
+                <dependency>
+                    <groupId>org.apache.seatunnel</groupId>
+                    <artifactId>connector-http-gitlab</artifactId>
+                    <version>${project.version}</version>
+                    <scope>provided</scope>
+                </dependency>
             </dependencies>
         </profile>
         <profile>
@@ -448,4 +454,4 @@
             </build>
         </profile>
     </profiles>
-</project>
\ No newline at end of file
+</project>
diff --git 
a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/pom.xml 
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/pom.xml
index 57e17acc9..d3fd0e846 100644
--- a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/pom.xml
+++ b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/pom.xml
@@ -62,6 +62,12 @@
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.seatunnel</groupId>
+            <artifactId>connector-http-gitlab</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
-</project>
\ No newline at end of file
+</project>
diff --git 
a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/java/org/apache/seatunnel/e2e/connector/http/HttpGitlabIT.java
 
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/java/org/apache/seatunnel/e2e/connector/http/HttpGitlabIT.java
new file mode 100644
index 000000000..7044bdb2a
--- /dev/null
+++ 
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/java/org/apache/seatunnel/e2e/connector/http/HttpGitlabIT.java
@@ -0,0 +1,77 @@
+/*
+ * 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.Objects;
+import java.util.stream.Stream;
+
+public class HttpGitlabIT 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(Objects.requireNonNull(HttpIT.class.getResource(
+                    
"/mockserver-gitlab-config.json")).getPath()).getAbsolutePath()),
+                "/tmp/mockserver-gitlab-config.json")
+            .withEnv("MOCKSERVER_INITIALIZATION_JSON_PATH", 
"/tmp/mockserver-gitlab-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 testHttpGitlabSourceToAssertSink(TestContainer container) 
throws IOException, InterruptedException {
+        Container.ExecResult execResult = 
container.executeJob("/gitlab_json_to_assert.conf");
+        Assertions.assertEquals(0, execResult.getExitCode());
+    }
+}
diff --git 
a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/resources/gitlab_json_to_assert.conf
 
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/resources/gitlab_json_to_assert.conf
new file mode 100644
index 000000000..136327533
--- /dev/null
+++ 
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/resources/gitlab_json_to_assert.conf
@@ -0,0 +1,77 @@
+#
+# 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.
+#
+
+env {
+  execution.parallelism = 1
+  job.mode = "BATCH"
+}
+
+source {
+  Gitlab {
+    url = "http://mockserver:1080/api/v4/projects";
+    access_token = "xxxx"
+    method = "GET"
+    format = "json"
+    schema = {
+      fields {
+        id = int
+        description = string
+        name = string
+        name_with_namespace = string
+        path = string
+        http_url_to_repo = string
+      }
+    }
+  }
+}
+
+sink {
+  Console {}
+  Assert {
+    rules {
+      field_rules = [
+        {
+          field_name = id
+          field_type = int
+          field_value = [
+            {
+              rule_type = NOT_NULL
+            }
+          ]
+        },
+        {
+          field_name = description
+          field_type = string
+          field_value = [
+            {
+              rule_type = NOT_NULL
+            }
+          ]
+        },
+        {
+          field_name = name
+          field_type = string
+          field_value = [
+            {
+              rule_type = NOT_NULL
+            }
+          ]
+        }
+      ]
+    }
+  }
+}
diff --git 
a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/resources/mockserver-gitlab-config.json
 
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/resources/mockserver-gitlab-config.json
new file mode 100644
index 000000000..34210bcc6
--- /dev/null
+++ 
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/resources/mockserver-gitlab-config.json
@@ -0,0 +1,22 @@
+// 
https://www.mock-server.com/mock_server/getting_started.html#request_matchers
+
+[
+  {
+    "httpRequest": {
+      "method": "GET",
+      "path": "/api/v4/projects"
+    },
+    "httpResponse": {
+      "body": [
+        {
+          "id": 41182117,
+          "description": "first project",
+          "name": "HTML and CSS exploration",
+          "name_with_namespace": "Isaac / HTML and CSS exploration",
+          "path": "html-and-css-exploration",
+          "http_url_to_repo": 
"https://gitlab.com/kttkpm_nhom2/apigatewayservice.git";
+        }
+      ]
+    }
+  }
+]

Reply via email to