fix(接口定义) 兼容 1.8 前单条用例认证数据处理

This commit is contained in:
fit2-zhao 2021-09-27 18:51:37 +08:00 committed by fit2-zhao
parent e459e87039
commit a96a6e93f8
1 changed files with 17 additions and 0 deletions

View File

@ -302,6 +302,23 @@ public class ElementUtil {
if (element != null && element.get("clazzName") == null && clazzMap.containsKey(element.getString("type"))) { if (element != null && element.get("clazzName") == null && clazzMap.containsKey(element.getString("type"))) {
element.fluentPut("clazzName", clazzMap.get(element.getString("type"))); element.fluentPut("clazzName", clazzMap.get(element.getString("type")));
} }
if (element != null && element.get("clazzName") == null && element.getString("type").equals("TCPSampler")) {
if (element.getString("tcpPreProcessor") != null) {
JSONObject tcpPreProcessor = JSON.parseObject(element.getString("tcpPreProcessor"));
if (tcpPreProcessor != null && tcpPreProcessor.get("clazzName") == null) {
tcpPreProcessor.fluentPut("clazzName", clazzMap.get(tcpPreProcessor.getString("type")));
element.fluentPut("tcpPreProcessor", tcpPreProcessor);
}
}
} else if (element != null && element.getString("type").equals("HTTPSamplerProxy")) {
if (element.getString("authManager") != null) {
JSONObject authManager = JSON.parseObject(element.getString("authManager"));
if (authManager != null && authManager.get("clazzName") == null) {
authManager.fluentPut("clazzName", clazzMap.get(authManager.getString("type")));
element.fluentPut("authManager", authManager);
}
}
}
if (element != null && element.containsKey("hashTree")) { if (element != null && element.containsKey("hashTree")) {
JSONArray elementJSONArray = element.getJSONArray("hashTree"); JSONArray elementJSONArray = element.getJSONArray("hashTree");
dataFormatting(elementJSONArray); dataFormatting(elementJSONArray);