MCPcopy
hub / github.com/appleboy/gin-jwt / TestRedisRefreshTokenStore_Integration

Function TestRedisRefreshTokenStore_Integration

store/redis_test.go:41–81  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

39}
40
41func TestRedisRefreshTokenStore_Integration(t *testing.T) {
42 host, port := setupRedisContainer(t)
43
44 // Create Redis store configuration
45 config := &RedisConfig{
46 Addr: fmt.Sprintf("%s:%s", host, port),
47 Password: "",
48 DB: 0,
49 CacheSize: 1024 * 1024, // 1MB for testing
50 CacheTTL: time.Second,
51 KeyPrefix: "test-jwt:",
52 }
53
54 store, err := NewRedisRefreshTokenStore(config)
55 require.NoError(t, err, "failed to create Redis store")
56 defer func() {
57 if closeErr := store.Close(); closeErr != nil {
58 t.Logf("failed to close Redis store: %v", closeErr)
59 }
60 }()
61
62 t.Run("BasicOperations", func(t *testing.T) {
63 testBasicOperations(t, store)
64 })
65
66 t.Run("Expiration", func(t *testing.T) {
67 testExpiration(t, store)
68 })
69
70 t.Run("Cleanup", func(t *testing.T) {
71 testCleanup(t, store)
72 })
73
74 t.Run("Count", func(t *testing.T) {
75 testCount(t, store)
76 })
77
78 t.Run("ClientSideCache", func(t *testing.T) {
79 testClientSideCache(t, store)
80 })
81}
82
83func testBasicOperations(t *testing.T, store *RedisRefreshTokenStore) {
84 ctx := context.Background()

Callers

nothing calls this directly

Calls 8

CloseMethod · 0.95
setupRedisContainerFunction · 0.85
testBasicOperationsFunction · 0.85
testExpirationFunction · 0.85
testCleanupFunction · 0.85
testCountFunction · 0.85
testClientSideCacheFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…