From 90e776b0f23c2d463613fc8448703b9ad0b99628 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Tue, 10 Jan 2023 22:32:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E4=B8=B2?= =?UTF-8?q?=E8=A1=8C=E6=97=B6=E5=9C=BA=E6=99=AF=E6=89=A7=E8=A1=8C=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=E4=B8=8D=E5=AF=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021826 --user=宋天阳 【测试跟踪】测试计划执行,勾选失败停止,场景在失败的用例后还有一个执行了的 https://www.tapd.cn/55049933/s/1325770 --- .../api/exec/scenario/ApiScenarioExecuteService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java b/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java index 9c65f8e055..f91e10a64e 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java +++ b/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java @@ -204,8 +204,11 @@ public class ApiScenarioExecuteService { if (CollectionUtils.isNotEmpty(testPlanApiScenarioList)) { List ids = testPlanApiScenarioList.stream().map(TestPlanApiScenarioInfoDTO::getApiScenarioId).collect(Collectors.toList()); request.setIds(ids); - vo.setTestPlanScenarioMap(testPlanApiScenarioList.stream() - .collect(Collectors.toMap(TestPlanApiScenarioInfoDTO::getId, Function.identity(), (t1, t2) -> t1))); + //这段代码之前的写法是开了testPlanApiScenarioList的流。但是这样造成的后果是获得了乱序的HashMap。而我们需要的是LinkedHashMap + testPlanApiScenarioList.forEach(dto -> { + vo.getTestPlanScenarioMap().put(dto.getId(), dto); + }); + } } else { ServiceUtils.getSelectAllIds(request, request.getCondition(), (query) -> extApiScenarioMapper.selectIdsByQuery(query));