(t *testing.T)
| 279 | } |
| 280 | |
| 281 | func TestInMemoryRefreshTokenStore_GetAll(t *testing.T) { |
| 282 | store := NewInMemoryRefreshTokenStore() |
| 283 | |
| 284 | // Add some tokens |
| 285 | validExpiry := time.Now().Add(time.Hour) |
| 286 | expiredExpiry := time.Now().Add(-time.Hour) |
| 287 | |
| 288 | _ = store.Set(context.Background(), "valid1", &User{ID: "1"}, validExpiry) |
| 289 | _ = store.Set(context.Background(), "valid2", &User{ID: "2"}, validExpiry) |
| 290 | _ = store.Set(context.Background(), "expired1", &User{ID: "3"}, expiredExpiry) |
| 291 | |
| 292 | all := store.GetAll() |
| 293 | |
| 294 | // Should only return valid tokens |
| 295 | if len(all) != 2 { |
| 296 | t.Fatalf("Expected 2 valid tokens, got %d", len(all)) |
| 297 | } |
| 298 | |
| 299 | if _, exists := all["valid1"]; !exists { |
| 300 | t.Fatal("valid1 should be in GetAll() result") |
| 301 | } |
| 302 | |
| 303 | if _, exists := all["valid2"]; !exists { |
| 304 | t.Fatal("valid2 should be in GetAll() result") |
| 305 | } |
| 306 | |
| 307 | if _, exists := all["expired1"]; exists { |
| 308 | t.Fatal("expired1 should not be in GetAll() result") |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | func TestInMemoryRefreshTokenStore_Clear(t *testing.T) { |
| 313 | store := NewInMemoryRefreshTokenStore() |
nothing calls this directly
no test coverage detected
searching dependent graphs…