(t *testing.T)
| 39 | } |
| 40 | |
| 41 | func 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 | |
| 83 | func testBasicOperations(t *testing.T, store *RedisRefreshTokenStore) { |
| 84 | ctx := context.Background() |
nothing calls this directly
no test coverage detected
searching dependent graphs…