package http_test import ( "context" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" http "github.com/valyala/fasthttp" repository "source.toby3d.me/website/oauth/internal/client/repository/http" "source.toby3d.me/website/oauth/internal/common" "source.toby3d.me/website/oauth/internal/domain" "source.toby3d.me/website/oauth/internal/util" ) func TestGet(t *testing.T) { t.Parallel() httpClient, _, cleanup := util.TestServe(t, func(ctx *http.RequestCtx) { ctx.SuccessString(common.MIMETextHTML, ` Example App
Example App
`) ctx.Response.Header.Set(http.HeaderLink, `; rel="redirect_uri">`) }) t.Cleanup(cleanup) client := domain.TestClient(t) result, err := repository.NewHTTPClientRepository(httpClient).Get(context.TODO(), client.ID) require.NoError(t, err) assert.Equal(t, client, result) }