From e99f7621cbabf8f00abfb381342349c1b817a5cc Mon Sep 17 00:00:00 2001 From: Wout Slakhorst Date: Fri, 8 Dec 2023 11:49:21 +0100 Subject: [PATCH] remove obsolete mustParseURL --- auth/oauth/error_test.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/auth/oauth/error_test.go b/auth/oauth/error_test.go index 1308c4a87b..ff175c0b85 100644 --- a/auth/oauth/error_test.go +++ b/auth/oauth/error_test.go @@ -21,11 +21,11 @@ package oauth import ( "errors" "github.com/labstack/echo/v4" + "github.com/nuts-foundation/nuts-node/test" "github.com/stretchr/testify/assert" "io" "net/http" "net/http/httptest" - "net/url" "strings" "testing" ) @@ -49,7 +49,7 @@ func Test_oauth2ErrorWriter_Write(t *testing.T) { err := Oauth2ErrorWriter{}.Write(ctx, 0, "", OAuth2Error{ Code: InvalidRequest, Description: "failure", - RedirectURI: mustParseURL("https://example.com"), + RedirectURI: test.MustParseURL("https://example.com"), }) assert.NoError(t, err) @@ -122,11 +122,3 @@ func Test_oauth2ErrorWriter_Write(t *testing.T) { assert.Equal(t, `server_error`, strings.TrimSpace(string(body))) }) } - -func mustParseURL(theURL string) *url.URL { - parsed, err := url.Parse(theURL) - if err != nil { - panic(err) - } - return parsed -}