fix(phase-5.2): 消项 CR 第二轮 P1/P2/P3(通道/证据链/交付时序/后管证据页)

This commit is contained in:
2026-10-31 21:12:18 +08:00
parent a4e4456b50
commit 91d36327f9
61 changed files with 2833 additions and 311 deletions
@@ -9,7 +9,6 @@ import com.nanri.aiimage.common.exception.BusinessException;
import com.nanri.aiimage.common.service.DistributedJobLockService;
import com.nanri.aiimage.common.service.ResultDownloadResolver;
import com.nanri.aiimage.config.AppearancePatentProperties;
import com.nanri.aiimage.config.CollectRoutingProperties;
import com.nanri.aiimage.config.InstanceMetadata;
import com.nanri.aiimage.config.StorageProperties;
import com.nanri.aiimage.modules.appearancepatent.client.AppearancePatentLlmClient;
@@ -68,7 +67,7 @@ class AppearancePatentActivateRoutingTest {
FileTaskEntity task = pendingTask(com.nanri.aiimage.modules.task.model.CollectChannel.LOCAL);
when(fileTaskMapper.selectById(TASK_ID)).thenReturn(task);
when(fileTaskMapper.update(isNull(), any())).thenReturn(1);
AppearancePatentTaskService service = service(new CollectRoutingProperties());
AppearancePatentTaskService service = service();
service.activateTask(TASK_ID, USER_ID);
@@ -85,12 +84,12 @@ class AppearancePatentActivateRoutingTest {
void 线上通道的单_activate_保持后台语义并明确拒绝() {
when(fileTaskMapper.selectById(TASK_ID))
.thenReturn(pendingTask(com.nanri.aiimage.modules.task.model.CollectChannel.ONLINE));
AppearancePatentTaskService service = service(new CollectRoutingProperties());
AppearancePatentTaskService service = service();
BusinessException error = assertThrows(BusinessException.class,
() -> service.activateTask(TASK_ID, USER_ID));
assertTrue(String.valueOf(error.getMessage()).contains("后台自动执行"), error.getMessage());
assertTrue(String.valueOf(error.getMessage()).contains("线上采集"), error.getMessage());
verify(fileTaskMapper, never()).update(isNull(), any());
}
@@ -100,7 +99,7 @@ class AppearancePatentActivateRoutingTest {
when(fileTaskMapper.selectById(TASK_ID)).thenReturn(task);
when(fileTaskMapper.update(isNull(), any())).thenReturn(1);
service(new CollectRoutingProperties()).activateTask(TASK_ID, USER_ID);
service().activateTask(TASK_ID, USER_ID);
verify(taskCacheService).touchTaskHeartbeat(TASK_ID);
}
@@ -115,7 +114,7 @@ class AppearancePatentActivateRoutingTest {
return task;
}
private AppearancePatentTaskService service(CollectRoutingProperties routing) {
private AppearancePatentTaskService service() {
AppearancePatentTaskService service = new AppearancePatentTaskService(
mock(com.nanri.aiimage.modules.file.service.LocalFileStorageService.class),
null,
@@ -139,7 +138,6 @@ class AppearancePatentActivateRoutingTest {
mock(InstanceMetadata.class),
mock(TaskProgressLightAssembler.class),
mock(UserApiSecretService.class));
ReflectionTestUtils.setField(service, "collectRoutingProperties", routing);
return service;
}