feat(接口测试): 修复非GET请求的接口会把请求体中的kv数据拼接到字符串上的问题

--bug=1012619 --user=宋天阳
[接口测试]github#12899Mock完成设置后,选择执行,响应结果不是mock设置里的响应结果。
https://www.tapd.cn/55049933/s/1145825
This commit is contained in:
song-tianyang 2022-04-24 17:32:50 +08:00 committed by 刘瑞斌
parent 121a04da51
commit 9d4f63cfb0
1 changed files with 1 additions and 1 deletions

View File

@ -188,7 +188,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
setSamplerPath(config, httpConfig, sampler); setSamplerPath(config, httpConfig, sampler);
// 请求体处理 // 请求体处理
if (this.body != null) { if (this.body != null && StringUtils.equalsAnyIgnoreCase(method,"POST","PUT","PATCH")) {
List<KeyValue> bodyParams = this.body.getBodyParams(sampler, this.getId()); List<KeyValue> bodyParams = this.body.getBodyParams(sampler, this.getId());
if (StringUtils.isNotEmpty(this.body.getType()) && "Form Data".equals(this.body.getType())) { if (StringUtils.isNotEmpty(this.body.getType()) && "Form Data".equals(this.body.getType())) {
AtomicBoolean kvIsEmpty = new AtomicBoolean(true); AtomicBoolean kvIsEmpty = new AtomicBoolean(true);