diff options
| author | mo khan <mo@mokhan.ca> | 2025-05-12 17:33:14 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-05-12 17:33:14 -0600 |
| commit | b83870b98562a1eb9d4377dffc2283706ad574f3 (patch) | |
| tree | 15c5285c39f3880e2e68f3621a6ba9bfb22694df /test/integration/oidc.go | |
| parent | 32e212fb891d522efa4990bc525a51326bd7e4ba (diff) | |
test: split integration test into separate files
Diffstat (limited to 'test/integration/oidc.go')
| -rw-r--r-- | test/integration/oidc.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/integration/oidc.go b/test/integration/oidc.go new file mode 100644 index 0000000..9fa465e --- /dev/null +++ b/test/integration/oidc.go @@ -0,0 +1,23 @@ +package test + +import ( + "net/http" + "testing" + + "github.com/oauth2-proxy/mockoidc" + "github.com/stretchr/testify/require" +) + +func NewOIDCTestServer(t *testing.T) *mockoidc.MockOIDC { + srv, err := mockoidc.Run() + require.NoError(t, err) + + srv.AddMiddleware(func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + t.Logf("%v %v %v\n", r.Method, r.URL.Path, r.URL.Query()) + next.ServeHTTP(w, r) + }) + }) + + return srv +} |
