summaryrefslogtreecommitdiff
path: root/internal/config/httpclient_test.go
blob: 474debaca2ab26c33e13f03a29e95af8a5b3f225 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)
}