(t *testing.T)
| 116 | } |
| 117 | |
| 118 | func TestInMemoryRefreshTokenStore_GetExpired(t *testing.T) { |
| 119 | store := NewInMemoryRefreshTokenStore() |
| 120 | user := &User{ID: "123", Username: "testuser"} |
| 121 | expiry := time.Now().Add(-time.Hour) // Expired 1 hour ago |
| 122 | |
| 123 | // Set an expired token |
| 124 | err := store.Set(context.Background(), "expired_token", user, expiry) |
| 125 | if err != nil { |
| 126 | t.Fatalf("Set() returned error: %v", err) |
| 127 | } |
| 128 | |
| 129 | // Try to get the expired token |
| 130 | _, err = store.Get(context.Background(), "expired_token") |
| 131 | if err != ErrRefreshTokenNotFound { |
| 132 | t.Fatalf("Expected ErrRefreshTokenNotFound for expired token, got: %v", err) |
| 133 | } |
| 134 | |
| 135 | // Verify the expired token was cleaned up |
| 136 | count, _ := store.Count(context.Background()) |
| 137 | if count != 0 { |
| 138 | t.Fatalf("Expected count to be 0 after expired token cleanup, got %d", count) |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | func TestInMemoryRefreshTokenStore_Delete(t *testing.T) { |
| 143 | store := NewInMemoryRefreshTokenStore() |
nothing calls this directly
no test coverage detected
searching dependent graphs…