fix(接口测试): 场景引用接口定义,form-data请求体显示的文件有误
--bug=1041173 --user=陈建星 【接口测试】场景-引用API-请求体为form-data/binary-类型为file-上传的文件修改后保存场景退出-再打开场景,文件还是旧文件 https://www.tapd.cn/55049933/s/1545860
This commit is contained in:
parent
39c60ea3b2
commit
4df37e5a6f
|
@ -2,6 +2,7 @@ package io.metersphere.api.parser.step;
|
|||
|
||||
import io.metersphere.api.domain.ApiDefinitionBlob;
|
||||
import io.metersphere.api.domain.ApiScenarioStep;
|
||||
import io.metersphere.api.dto.request.http.body.FormDataKV;
|
||||
import io.metersphere.project.api.KeyValueParam;
|
||||
import io.metersphere.api.dto.request.http.MsHTTPElement;
|
||||
import io.metersphere.api.dto.request.http.body.Body;
|
||||
|
@ -106,11 +107,14 @@ public class ApiStepParser extends StepParser {
|
|||
return;
|
||||
}
|
||||
refList.forEach(item -> {
|
||||
KeyValueParam keyValueParam = (KeyValueParam) item;
|
||||
KeyValueParam refParam = (KeyValueParam) item;
|
||||
for (Object valueItem : valueList) {
|
||||
KeyValueParam valueParam = (KeyValueParam) valueItem;
|
||||
if (StringUtils.equals(keyValueParam.getKey(), valueParam.getKey())) {
|
||||
keyValueParam.setValue(valueParam.getValue());
|
||||
if (StringUtils.equals(refParam.getKey(), valueParam.getKey())) {
|
||||
refParam.setValue(valueParam.getValue());
|
||||
if (refParam instanceof FormDataKV refFormDataKey && valueParam instanceof FormDataKV valueFormDataKey) {
|
||||
refFormDataKey.setFiles(valueFormDataKey.getFiles());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue