fix(接口测试): 复制的用例和步骤,没有保存,执行报错

This commit is contained in:
AgAngle 2024-04-01 20:12:33 +08:00 committed by Craftsman
parent fe852441a1
commit fbdf3b1be3
1 changed files with 4 additions and 1 deletions

View File

@ -1240,6 +1240,9 @@ public class ApiScenarioService extends MoveNodeService {
msScenario.setScenarioConfig(getScenarioConfig(request, hasSave));
msScenario.setProjectId(request.getProjectId());
// 处理特殊的步骤详情
addSpecialStepDetails(request.getSteps(), request.getStepDetails());
ApiScenarioParseTmpParam tmpParam = parse(msScenario, request.getSteps(), request);
ApiResourceRunRequest runRequest = getApiResourceRunRequest(msScenario, tmpParam);
@ -1750,7 +1753,7 @@ public class ApiScenarioService extends MoveNodeService {
.collect(Collectors.toMap(ApiScenarioStepBlob::getId, blob -> new String(blob.getContent())));
// 前端有传就用前端传的
if (stepDetailsParam != null) {
stepDetailsParam.forEach((stepId, detail) -> stepDetails.put(stepId, JSON.toJSONString(detail)));
stepDetailsParam.forEach((stepId, detail) -> stepDetails.put(stepId, detail instanceof byte[] bytes ? new String(bytes) : JSON.toJSONString(detail)));
}
return stepDetails;
}