fix(接口测试): 引用的接口定义,修改binaryBody参数不生效
--bug=1041173 --user=陈建星 【接口测试】场景-引用API-请求体为form-data/binary-类型为file-上传的文件修改后保存场景退出-再打开场景,文件还是旧文件 https://www.tapd.cn/55049933/s/1522093
This commit is contained in:
parent
e42c1d76e6
commit
d387202f78
|
@ -91,6 +91,10 @@ public class ApiStepParser extends StepParser {
|
|||
valueBody.getWwwFormBody() != null && refBody.getWwwFormBody() != null) {
|
||||
replaceKvParam(valueBody.getWwwFormBody().getFormValues(), valueBody.getWwwFormBody().getFormValues());
|
||||
}
|
||||
if (StringUtils.equals(refBody.getBodyType(), Body.BodyType.BINARY.name()) &&
|
||||
valueBody.getBinaryBody() != null && refBody.getBinaryBody() != null) {
|
||||
refBody.getBinaryBody().setFile(valueBody.getBinaryBody().getFile());
|
||||
}
|
||||
// todo JsonSchema body
|
||||
}
|
||||
|
||||
|
|
|
@ -639,8 +639,9 @@ public class ApiScenarioControllerTests extends BaseTest {
|
|||
Map<String, Object> steptDetailMap = new HashMap<>();
|
||||
MsHTTPElement msHttpElement = MsHTTPElementTest.getMsHttpElement();
|
||||
msHttpElement.setBody(ApiDebugControllerTests.addBodyLinkFile(msHttpElement.getBody(), fileMetadataId));
|
||||
steptDetailMap.put(steps.get(0).getId(), getMsHttpElementStr(msHttpElement));
|
||||
steptDetailMap.put(steps.get(1).getId(), getMsHttpElementStr(msHttpElement));
|
||||
for (ApiScenarioStepRequest step : steps) {
|
||||
steptDetailMap.put(step.getId(), getMsHttpElementStr(msHttpElement));
|
||||
}
|
||||
fileMetadataStepId = steps.get(0).getId();
|
||||
|
||||
request.setSteps(steps);
|
||||
|
|
Loading…
Reference in New Issue