fix(UI自动化): 修复任务中心全部停止问题

This commit is contained in:
zhangyong 2022-10-18 15:33:28 +08:00 committed by zhangyongfit2cloud
parent fb42e27062
commit 09da402c26
1 changed files with 2 additions and 2 deletions

View File

@ -85,13 +85,13 @@ public class TaskService {
if (CollectionUtils.isNotEmpty(reportIds)) { if (CollectionUtils.isNotEmpty(reportIds)) {
// 任务中心单条停止/全部停止 // 任务中心单条停止/全部停止
Map<String, TaskRequestDTO> taskRequestMap = reportIds.stream().collect(Collectors.toMap(TaskRequestDTO::getType, taskRequest -> taskRequest)); Map<String, TaskRequestDTO> taskRequestMap = reportIds.stream().collect(Collectors.toMap(TaskRequestDTO::getType, taskRequest -> taskRequest));
if (taskRequestMap.containsKey(API) || taskRequestMap.containsKey(SCENARIO)) { if (taskRequestMap.containsKey(API)) {
microService.postForData(MicroServiceName.API_TEST, "/api/automation/stop/batch", reportIds); microService.postForData(MicroServiceName.API_TEST, "/api/automation/stop/batch", reportIds);
} }
if (taskRequestMap.containsKey(PERF)) { if (taskRequestMap.containsKey(PERF)) {
microService.postForData(MicroServiceName.PERFORMANCE_TEST, "/performance/stop/batch", taskRequestMap.get(PERF)); microService.postForData(MicroServiceName.PERFORMANCE_TEST, "/performance/stop/batch", taskRequestMap.get(PERF));
} }
if(taskRequestMap.containsKey(UI)){ if(taskRequestMap.containsKey(UI) || taskRequestMap.containsKey(SCENARIO)) {
microService.postForData(MicroServiceName.UI_TEST, "/ui/automation/stop/batch", reportIds); microService.postForData(MicroServiceName.UI_TEST, "/ui/automation/stop/batch", reportIds);
} }
} }