From eed3990fd04572d684238247ae2004479cda33f8 Mon Sep 17 00:00:00 2001 From: yisaer Date: Wed, 10 Jan 2024 15:31:37 +0800 Subject: [PATCH] fix Signed-off-by: yisaer --- internal/io/http/httppull_source_test.go | 129 +++++++++++++---------- 1 file changed, 72 insertions(+), 57 deletions(-) diff --git a/internal/io/http/httppull_source_test.go b/internal/io/http/httppull_source_test.go index 012de6d893..a50daf3aa3 100644 --- a/internal/io/http/httppull_source_test.go +++ b/internal/io/http/httppull_source_test.go @@ -33,6 +33,7 @@ import ( "github.com/lf-edge/ekuiper/internal/conf" "github.com/lf-edge/ekuiper/internal/io/mock" + "github.com/lf-edge/ekuiper/internal/pkg/cert" "github.com/lf-edge/ekuiper/internal/topo/topotest/mockclock" "github.com/lf-edge/ekuiper/internal/xsql" "github.com/lf-edge/ekuiper/pkg/api" @@ -322,15 +323,17 @@ func TestConfigure(t *testing.T) { "url": "http://localhost:9090/", }, config: &RawConf{ - Incremental: true, - Url: "http://localhost:9090/", - ResendUrl: "http://localhost:9090/", - Method: http.MethodGet, - Interval: DefaultInterval, - Timeout: DefaultTimeout, - BodyType: "none", - ResponseType: "code", - InsecureSkipVerify: true, + Incremental: true, + Url: "http://localhost:9090/", + ResendUrl: "http://localhost:9090/", + Method: http.MethodGet, + Interval: DefaultInterval, + Timeout: DefaultTimeout, + BodyType: "none", + ResponseType: "code", + TlsConfigurationOptions: &cert.TlsConfigurationOptions{ + SkipCertVerify: true, + }, }, }, // Test wrong properties @@ -422,14 +425,16 @@ func TestConfigure(t *testing.T) { }, }, config: &RawConf{ - Url: "http://localhost:52345/", - ResendUrl: "http://localhost:52345/", - Method: http.MethodGet, - Interval: DefaultInterval, - Timeout: DefaultTimeout, - BodyType: "none", - ResponseType: "code", - InsecureSkipVerify: true, + Url: "http://localhost:52345/", + ResendUrl: "http://localhost:52345/", + Method: http.MethodGet, + Interval: DefaultInterval, + Timeout: DefaultTimeout, + BodyType: "none", + ResponseType: "code", + TlsConfigurationOptions: &cert.TlsConfigurationOptions{ + SkipCertVerify: true, + }, Headers: map[string]interface{}{ "Authorization": "Bearer {{.token}}", }, @@ -473,14 +478,16 @@ func TestConfigure(t *testing.T) { }, }, config: &RawConf{ - Url: "http://localhost:52345/", - ResendUrl: "http://localhost:52345/", - Method: http.MethodGet, - Interval: DefaultInterval, - Timeout: DefaultTimeout, - BodyType: "none", - ResponseType: "code", - InsecureSkipVerify: true, + Url: "http://localhost:52345/", + ResendUrl: "http://localhost:52345/", + Method: http.MethodGet, + Interval: DefaultInterval, + Timeout: DefaultTimeout, + BodyType: "none", + ResponseType: "code", + TlsConfigurationOptions: &cert.TlsConfigurationOptions{ + SkipCertVerify: true, + }, Headers: map[string]interface{}{ "Authorization": "Bearer {{.token}}", }, @@ -531,14 +538,16 @@ func TestConfigure(t *testing.T) { }, }, config: &RawConf{ - Url: "http://localhost:52345/", - ResendUrl: "http://localhost:52345/", - Method: http.MethodGet, - Interval: DefaultInterval, - Timeout: DefaultTimeout, - BodyType: "none", - ResponseType: "code", - InsecureSkipVerify: true, + Url: "http://localhost:52345/", + ResendUrl: "http://localhost:52345/", + Method: http.MethodGet, + Interval: DefaultInterval, + Timeout: DefaultTimeout, + BodyType: "none", + ResponseType: "code", + TlsConfigurationOptions: &cert.TlsConfigurationOptions{ + SkipCertVerify: true, + }, Headers: map[string]interface{}{ "Authorization": "Bearer {{.token}}", }, @@ -612,14 +621,16 @@ func TestConfigure(t *testing.T) { }, }, config: &RawConf{ - Url: "http://localhost:52345/", - ResendUrl: "http://localhost:52345/", - Method: http.MethodGet, - Interval: DefaultInterval, - Timeout: DefaultTimeout, - BodyType: "none", - ResponseType: "code", - InsecureSkipVerify: true, + Url: "http://localhost:52345/", + ResendUrl: "http://localhost:52345/", + Method: http.MethodGet, + Interval: DefaultInterval, + Timeout: DefaultTimeout, + BodyType: "none", + ResponseType: "code", + TlsConfigurationOptions: &cert.TlsConfigurationOptions{ + SkipCertVerify: true, + }, Headers: map[string]interface{}{ "Authorization": "Bearer {{.token}}", }, @@ -685,14 +696,16 @@ func TestConfigure(t *testing.T) { }, }, config: &RawConf{ - Url: "http://localhost:52345/", - ResendUrl: "http://localhost:52345/", - Method: http.MethodGet, - Interval: DefaultInterval, - Timeout: DefaultTimeout, - BodyType: "none", - ResponseType: "code", - InsecureSkipVerify: true, + Url: "http://localhost:52345/", + ResendUrl: "http://localhost:52345/", + Method: http.MethodGet, + Interval: DefaultInterval, + Timeout: DefaultTimeout, + BodyType: "none", + ResponseType: "code", + TlsConfigurationOptions: &cert.TlsConfigurationOptions{ + SkipCertVerify: true, + }, Headers: map[string]interface{}{ "Authorization": "Bearer {{.token}}", }, @@ -737,14 +750,16 @@ func TestConfigure(t *testing.T) { }, }, config: &RawConf{ - Url: "http://localhost:52345/", - ResendUrl: "http://localhost:52345/", - Method: http.MethodGet, - Interval: DefaultInterval, - Timeout: DefaultTimeout, - BodyType: "json", - ResponseType: "code", - InsecureSkipVerify: true, + Url: "http://localhost:52345/", + ResendUrl: "http://localhost:52345/", + Method: http.MethodGet, + Interval: DefaultInterval, + Timeout: DefaultTimeout, + BodyType: "json", + ResponseType: "code", + TlsConfigurationOptions: &cert.TlsConfigurationOptions{ + SkipCertVerify: true, + }, Headers: map[string]string{ "Authorization": "Bearer {{.token}}", },