mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-05 05:29:29 +08:00
fix(接口测试): 修复jsonpath断言空数组错误的缺陷
--bug=1027632 --user=王孝刚 【接口定义】github #25437 升级到新版后原来场景断言失败 https://www.tapd.cn/55049933/s/1390488
This commit is contained in:
parent
e13d15d129
commit
e229eb3ae4
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user