...
1 package handlers
2
3 import (
4 "net/http/httptest"
5 "testing"
6
7 "github.com/gin-gonic/gin"
8 "github.com/stretchr/testify/assert"
9
10 "edge-infra.dev/pkg/edge/auth-proxy/session"
11 "edge-infra.dev/pkg/lib/fog"
12 "edge-infra.dev/pkg/lib/uuid"
13 )
14
15 const (
16 testTokenSecret = "test-token"
17 )
18
19 func TestNew(t *testing.T) {
20 mockSessions = session.NewMockSessions()
21 httpRecorder := httptest.NewRecorder()
22 ginCtx, _ := gin.CreateTestContext(httpRecorder)
23 proxyHandler := New(ginCtx, fog.New(), mockSessions, testTokenSecret, session.DefaultDuration, false, uuid.New().UUID)
24 assert.NotEmpty(t, proxyHandler)
25 }
26
View as plain text