fix(接口自动化): 修复DELETE参数丢失问题

This commit is contained in:
fit2-zhao 2021-01-26 11:40:44 +08:00
parent cf013c1e84
commit 46737136d9
2 changed files with 10 additions and 2 deletions

View File

@ -18,6 +18,7 @@ import org.apache.jmeter.protocol.http.control.Header;
import org.apache.jmeter.protocol.http.control.HeaderManager;
import org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy;
import org.apache.jmeter.protocol.http.util.HTTPArgument;
import org.apache.jmeter.protocol.http.util.HTTPConstants;
import org.apache.jmeter.save.SaveService;
import org.apache.jmeter.testelement.TestElement;
import org.apache.jorphan.collections.HashTree;
@ -152,7 +153,14 @@ public class MsHTTPSamplerProxy extends MsTestElement {
sampler.setPath(envPath);
}
if (CollectionUtils.isNotEmpty(this.getArguments())) {
sampler.setPath(getPostQueryParameters(URLDecoder.decode(envPath, "UTF-8")));
String path = getPostQueryParameters(URLDecoder.decode(envPath, "UTF-8"));
if (HTTPConstants.DELETE.equals(this.getMethod())) {
if (!path.startsWith("/")) {
path = "/" + path;
}
path = sampler.getProtocol() + "://" + sampler.getDomain() + ":" + sampler.getPort() + path;
}
sampler.setPath(path);
}
} else {
String url = this.getUrl();

View File

@ -51,7 +51,7 @@
</div>
</el-col>
<el-col :span="1" v-if="!(isReadOnly || isCaseEdit)">
<el-button size="small" type="primary" @click="addCase">+{{$t('api_test.definition.request.case')}}</el-button>
<el-button size="small" type="primary" @click="addCase" v-tester>+{{$t('api_test.definition.request.case')}}</el-button>
</el-col>
</el-row>
</el-card>