fix(接口测试): 修复场景步骤中包含自定义请求的jmx报错的缺陷

This commit is contained in:
wxg0103 2023-05-22 19:28:40 +08:00 committed by wxg0103
parent 93853efce8
commit 846a402e4d
1 changed files with 2 additions and 2 deletions

View File

@ -88,7 +88,7 @@ public class ElementUtil {
this.add(ElementConstants.JSR223_POST); this.add(ElementConstants.JSR223_POST);
}}; }};
public static final String JSR = "jsr223"; public static final String JSR = "jsr223";
public static final String CLAZZ = "clazzName";
@ -401,7 +401,7 @@ public class ElementUtil {
} }
public static void setDomain(JSONObject element, MsParameter msParameter) { public static void setDomain(JSONObject element, MsParameter msParameter) {
if (!StringUtils.equals(element.optString("type"), ElementConstants.HTTP_SAMPLER)) { if (!StringUtils.equals(element.optString(MsHashTreeService.TYPE), ElementConstants.HTTP_SAMPLER) || !element.has(CLAZZ)) {
return; return;
} }
MsHTTPSamplerProxy httpSamplerProxy = JSON.parseObject(element.toString(), MsHTTPSamplerProxy.class); MsHTTPSamplerProxy httpSamplerProxy = JSON.parseObject(element.toString(), MsHTTPSamplerProxy.class);