Skip to content

Commit 9c68601

Browse files
committed
[Fix][connector-http] add test cases
1 parent 4a3b958 commit 9c68601

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

Diff for: seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/java/org/apache/seatunnel/e2e/connector/http/HttpIT.java

+3
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ public void testSourceToAssertSink(TestContainer container)
357357
Container.ExecResult execResult19 =
358358
container.executeJob("/http_page_increase_start_num.conf");
359359
Assertions.assertEquals(0, execResult19.getExitCode());
360+
361+
Container.ExecResult execResult21 = container.executeJob("/http_to_console.conf");
362+
Assertions.assertEquals(0, execResult21.getExitCode());
360363
}
361364

362365
@TestTemplate
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
######
18+
###### This config file is a demonstration of streaming processing in seatunnel config
19+
######
20+
21+
env {
22+
parallelism = 1
23+
job.mode = "BATCH"
24+
}
25+
source{
26+
Http {
27+
url = "https://api-seller.ozon.ru/v2/finance/realization"
28+
method = "POST"
29+
headers = {Client-Id="32653",Api-Key="e153c36f-3c78-4202-87cd-6c08ee283285"}
30+
body =" {\"month\": 2,\"year\": 2025}"
31+
format = "json"
32+
json_field = {
33+
barcode = "$.result.rows[*].item.barcode"
34+
amount = "$.result.rows[*].delivery_commission.amount"
35+
}
36+
37+
schema = {
38+
fields {
39+
barcode = string
40+
amount= string
41+
}
42+
}
43+
}
44+
}
45+
transform{
46+
}
47+
sink {
48+
Console{}
49+
#Jdbc {
50+
# url = "jdbc:mysql://***:3306/?rewriteBatchedStatements=true"
51+
# driver = "com.mysql.cj.jdbc.Driver"
52+
# user = "root"
53+
# password = "***"
54+
# database = "test"
55+
# table = "demo"
56+
# # primary_keys = ["key1", "key2", ...]
57+
# schema_save_mode = "CREATE_SCHEMA_WHEN_NOT_EXIST"
58+
# data_save_mode="DROP_DATA"
59+
# generate_sink_sql=true
60+
#}
61+
}

0 commit comments

Comments
 (0)