项目结构类名称优化
This commit is contained in:
@@ -2,7 +2,7 @@ package com.label.integration;
|
||||
|
||||
import com.label.AbstractIntegrationTest;
|
||||
import com.label.service.RedisService;
|
||||
import com.label.util.RedisKeyManager;
|
||||
import com.label.util.RedisUtil;
|
||||
|
||||
import org.junit.jupiter.api.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -61,7 +61,7 @@ public class TaskClaimConcurrencyTest extends AbstractIntegrationTest {
|
||||
tokens.add(token);
|
||||
// 所有 Token 使用 userId=3(annotator01),这在真实场景不会发生
|
||||
// 但在测试中用于验证并发锁机制(redis key 基于 taskId,不是 userId)
|
||||
redisService.hSetAll(RedisKeyManager.tokenKey(token),
|
||||
redisService.hSetAll(RedisUtil.tokenKey(token),
|
||||
Map.of("userId", String.valueOf(i + 100), // 假设 userId > 100 不存在,但不影响锁逻辑
|
||||
"role", "ANNOTATOR", "companyId", "1", "username", "annotator" + i),
|
||||
3600L);
|
||||
@@ -70,9 +70,9 @@ public class TaskClaimConcurrencyTest extends AbstractIntegrationTest {
|
||||
|
||||
@AfterEach
|
||||
void cleanup() {
|
||||
tokens.forEach(token -> redisService.delete(RedisKeyManager.tokenKey(token)));
|
||||
tokens.forEach(token -> redisService.delete(RedisUtil.tokenKey(token)));
|
||||
if (taskId != null) {
|
||||
redisService.delete(RedisKeyManager.taskClaimKey(taskId));
|
||||
redisService.delete(RedisUtil.taskClaimKey(taskId));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user