X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=auth-token-fetch%2FHTTPClient_test.go;h=f9d2fa3ad507108c363eeb00a50b8f227512b71a;hb=HEAD;hp=e0a4cd131a3a900892101c61294f8e1b679ffa94;hpb=0d129fcb9c18a4fdc989a4c338d8407fea76ee97;p=nonrtric.git diff --git a/auth-token-fetch/HTTPClient_test.go b/auth-token-fetch/HTTPClient_test.go index e0a4cd13..f9d2fa3a 100644 --- a/auth-token-fetch/HTTPClient_test.go +++ b/auth-token-fetch/HTTPClient_test.go @@ -23,7 +23,6 @@ package main import ( "crypto/tls" - "net/http" "reflect" "testing" "time" @@ -31,29 +30,12 @@ import ( "github.com/stretchr/testify/require" ) -func TestRequestError_Error(t *testing.T) { - assertions := require.New(t) - actualError := RequestError{ - StatusCode: http.StatusBadRequest, - Body: []byte("error"), - } - assertions.Equal("Request failed due to error response with status: 400 and body: error", actualError.Error()) -} - func Test_CreateClient(t *testing.T) { assertions := require.New(t) - client := CreateHttpClient(tls.Certificate{}, 5*time.Second) + client := CreateHttpClient(tls.Certificate{}, nil, 5*time.Second) transport := client.Transport assertions.Equal("*http.Transport", reflect.TypeOf(transport).String()) assertions.Equal(5*time.Second, client.Timeout) } - -func TestIsUrlSecured(t *testing.T) { - assertions := require.New(t) - - assertions.True(IsUrlSecure("https://url")) - - assertions.False(IsUrlSecure("http://url")) -}