fix(接口测试): 修复场景步骤另存用例问题

--bug=1024018 --user=赵勇 [接口测试]github#22473接口自动化中复制的API另存为CASE后,在新场景中引用该CASE,保存场景再次进入编辑,显示“原始API不存在” https://www.tapd.cn/55049933/s/1345838

Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
fit2-zhao 2023-03-07 10:25:58 +08:00 committed by fit2-zhao
parent a956a3707b
commit 8a263ce09d

View File

@ -438,6 +438,10 @@ public class ApiTestCaseService {
private ApiTestCase createTest(SaveApiTestCaseRequest request, List<MultipartFile> bodyFiles) {
checkNameExist(request);
ApiFileUtil.createBodyFiles(request.getId(), bodyFiles);
if (request.getRequest() != null) {
request.getRequest().setRefType(MsHashTreeConstants.CASE);
request.getRequest().setEnable(true);
}
request.setRequest(tcpApiParamService.parseMsTestElement(request.getRequest()));
if (StringUtils.isNotBlank(request.getSourceIdByCopy())) {
ApiFileUtil.copyBdyFile(request.getSourceIdByCopy(), request.getId());