fix(接口测试): 修复jsonpath断言空数组错误的缺陷

--bug=1027632 --user=王孝刚 【接口定义】github #25437 升级到新版后原来场景断言失败
https://www.tapd.cn/55049933/s/1390488
This commit is contained in:
wxg0103 2023-07-07 19:06:22 +08:00 committed by 刘瑞斌
parent e13d15d129
commit e229eb3ae4

View File

@ -129,7 +129,6 @@ public class JSONPathAssertion extends AbstractTestElement implements Serializab
public boolean isUseRegex() {
return getPropertyAsBoolean(ISREGEX, true);
}
private static final String KEY_PRE = "[]";
private void doAssert(String jsonString) {
@ -255,10 +254,10 @@ public class JSONPathAssertion extends AbstractTestElement implements Serializab
private boolean isEquals(Object subj) {
String str = DocumentUtils.objectToString(subj, decimalFormatter);
if (StringUtils.equals(str, KEY_PRE)) {
return false;
}
if (isUseRegex()) {
if (StringUtils.equals(str,KEY_PRE)) {
return false;
}
if (USE_JAVA_REGEX) {
return JMeterUtils.compilePattern(getExpectedValue()).matcher(str).matches();
} else {