Skip to content

Commit

Permalink
remove obsolete mustParseURL
Browse files Browse the repository at this point in the history
  • Loading branch information
woutslakhorst committed Dec 8, 2023
1 parent f8f76b4 commit e99f762
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions auth/oauth/error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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)
Expand Down Expand Up @@ -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
}

0 comments on commit e99f762

Please sign in to comment.