fix(接口测试): 修复mock请求体可以设置jmeter内置函数的问题

--bug=1010903 --user=宋天阳 【接口测试】github#11208,设置了Mock后 字段 为什么是null值
This commit is contained in:
song-tianyang 2022-03-08 18:46:32 +08:00 committed by CountryBuilder
parent 62ee9e513c
commit 537bf150ec
1 changed files with 7 additions and 5 deletions

View File

@ -709,11 +709,13 @@ public class MockApiUtils {
}
public static boolean checkParamsCompliance(JSONArray jsonArray, List<MockConfigRequestParams> mockConfigRequestParamList, boolean isAllMatch) {
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject obj = jsonArray.getJSONObject(i);
boolean isMatch = checkParamsCompliance(obj, mockConfigRequestParamList, isAllMatch);
if (isMatch) {
return true;
if (jsonArray != null) {
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject obj = jsonArray.getJSONObject(i);
boolean isMatch = checkParamsCompliance(obj, mockConfigRequestParamList, isAllMatch);
if (isMatch) {
return true;
}
}
}
return false;