fix(鉴权/测试): 用户态工具鉴权改开关控制(默认关)+ 修复既有测试编译与断言

- collect-data/price-track 兜底鉴权改由 aiimage.security.user-tool-guard-enabled
  控制,默认 false:老客户端直连不带认证头,先开启会让线上集采/跟价全线 401,
  待携带 X-Internal-Token 的新客户端铺开后再置 true
- 补齐 DistributedJobLockService 构造参数缺失的 6 个测试类(双活分布式锁
  commit 只改了主代码,测试已无法编译);断言按"先删 DB 行再物理删"的现语义校正
This commit is contained in:
2026-09-11 18:03:54 +08:00
parent dcd4f59636
commit 01dd35a6f4
8 changed files with 62 additions and 24 deletions
@@ -301,6 +301,7 @@ class PublishBatchLoadingSnapshotEquivTest {
mock(TaskScopeStateMapper.class), taskFileJobService,
mock(TaskDistributedLockService.class), mock(TransientPayloadStorageService.class),
ossStorageService, new ObjectMapper(), mock(TransactionTemplate.class),
mock(com.nanri.aiimage.common.service.DistributedJobLockService.class, org.mockito.Answers.RETURNS_MOCKS),
mock(InstanceMetadata.class),
mock(TaskProgressLightAssembler.class));
}
@@ -179,6 +179,7 @@ class PublishDashboardAggregateTest {
mock(TaskScopeStateMapper.class), taskFileJobService,
mock(TaskDistributedLockService.class), mock(TransientPayloadStorageService.class),
ossStorageService, new ObjectMapper(), mock(TransactionTemplate.class),
mock(com.nanri.aiimage.common.service.DistributedJobLockService.class, org.mockito.Answers.RETURNS_MOCKS),
mock(InstanceMetadata.class),
mock(TaskProgressLightAssembler.class));
}