fix: add missing PCE parameter to GenerateTokenPair calls in test files

The JWT GenerateTokenPair functions were updated to require a PCE (Password
Changed Epoch) parameter for token invalidation. This commit updates test files
in concurrent and performance packages to include this parameter.

- internal/concurrent/concurrent_test.go: 2 call sites fixed
- internal/performance/benchmark_test.go: 3 call sites fixed
- internal/performance/performance_test.go: 4 call sites fixed
This commit is contained in:
2026-04-18 20:16:45 +08:00
parent 61c19e54ac
commit a754545072
3 changed files with 9 additions and 9 deletions

View File

@@ -68,13 +68,13 @@ func BenchmarkJWTGenerateToken(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, _, _ = jwtManager.GenerateTokenPair(int64(i), "testuser")
_, _, _ = jwtManager.GenerateTokenPair(int64(i), "testuser", 0)
}
}
func BenchmarkJWTValidateToken(b *testing.B) {
jwtManager := auth.NewJWT("benchmark-secret-key-32bytes!", 2*time.Hour, 7*24*time.Hour)
token, _, _ := jwtManager.GenerateTokenPair(1, "testuser")
token, _, _ := jwtManager.GenerateTokenPair(1, "testuser", 0)
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -87,7 +87,7 @@ func BenchmarkJWTGenerateAndValidate(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
token, _, _ := jwtManager.GenerateTokenPair(int64(i), "testuser")
token, _, _ := jwtManager.GenerateTokenPair(int64(i), "testuser", 0)
jwtManager.ValidateAccessToken(token)
}
}