From 61598cf8c8a2dbae368f3f8b15393c70d2e4fa9d Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 7 May 2025 09:37:04 -0700 Subject: refactor: move test server to oidc package --- app/middleware/id_token_test.go | 4 ++-- app/middleware/require_user_test.go | 2 +- app/middleware/user_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app/middleware') diff --git a/app/middleware/id_token_test.go b/app/middleware/id_token_test.go index 06e9c96..95d9b40 100644 --- a/app/middleware/id_token_test.go +++ b/app/middleware/id_token_test.go @@ -10,16 +10,16 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/xlgmokha/x/pkg/log" + "github.com/xlgmokha/x/pkg/test" "github.com/xlgmokha/x/pkg/x" xcfg "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/cfg" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/oidc" - "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/test" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/web" "golang.org/x/oauth2" ) func TestIDToken(t *testing.T) { - srv := test.NewOIDCServer(t) + srv := oidc.NewTestServer(t) defer srv.Close() client := &http.Client{Transport: &web.Transport{Logger: log.New(os.Stdout, log.Fields{})}} diff --git a/app/middleware/require_user_test.go b/app/middleware/require_user_test.go index 92734b2..07cbf92 100644 --- a/app/middleware/require_user_test.go +++ b/app/middleware/require_user_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/stretchr/testify/require" + "github.com/xlgmokha/x/pkg/test" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/cfg" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/domain" - "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/test" ) func TestRequireUser(t *testing.T) { diff --git a/app/middleware/user_test.go b/app/middleware/user_test.go index 3e2425c..e1bbcf9 100644 --- a/app/middleware/user_test.go +++ b/app/middleware/user_test.go @@ -6,12 +6,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/xlgmokha/x/pkg/test" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/cfg" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/db" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/domain" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/oidc" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/pls" - "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/test" ) func TestUser(t *testing.T) { -- cgit v1.2.3