summaryrefslogtreecommitdiff
path: root/internal/config/httpclient_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/httpclient_test.go')
-rw-r--r--internal/config/httpclient_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/config/httpclient_test.go b/internal/config/httpclient_test.go
new file mode 100644
index 0000000..474deba
--- /dev/null
+++ b/internal/config/httpclient_test.go
@@ -0,0 +1,22 @@
+package config
+
+import (
+ "testing"
+ "time"
+
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+)
+
+func TestReadTimeout(t *testing.T) {
+ expectedSeconds := uint64(300)
+
+ config := &Config{
+ GitlabUrl: "http://localhost:3000",
+ HttpSettings: HttpSettingsConfig{ReadTimeoutSeconds: expectedSeconds},
+ }
+ client := config.GetHttpClient()
+
+ require.NotNil(t, client)
+ assert.Equal(t, time.Duration(expectedSeconds)*time.Second, client.HttpClient.Timeout)
+}