fix(接口测试): 修复不校验断言失败的缺陷
--bug=1039015 --user=王孝刚 【接口测试】场景-创建场景-添加响应体断言-匹配条件是不校验,执行结果错误 https://www.tapd.cn/55049933/s/1495788
This commit is contained in:
parent
a36044ee16
commit
d2419e0f33
|
@ -64,7 +64,8 @@ public class VariableAssertionConverter extends AssertionConverter<MsVariableAss
|
|||
public boolean isValid(MsVariableAssertion.VariableAssertionItem variableAssertionItem) {
|
||||
return StringUtils.isNotBlank(variableAssertionItem.getVariableName())
|
||||
&& StringUtils.isNotBlank(variableAssertionItem.getCondition())
|
||||
&& BooleanUtils.isTrue(variableAssertionItem.getEnable());
|
||||
&& BooleanUtils.isTrue(variableAssertionItem.getEnable())
|
||||
&& !StringUtils.equals(variableAssertionItem.getCondition(), MsAssertionCondition.UNCHECK.name());
|
||||
}
|
||||
|
||||
private static String parse2BeanshellJSR233Script(MsVariableAssertion.VariableAssertionItem variableAssertionItem) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package io.metersphere.project.api.assertion.body;
|
||||
|
||||
import io.metersphere.sdk.constants.MsAssertionCondition;
|
||||
import io.metersphere.system.valid.EnumValue;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
@ -31,7 +32,10 @@ public class MsJSONPathAssertionItem extends MsBodyAssertionItem {
|
|||
private String expectedValue;
|
||||
|
||||
public boolean isValid() {
|
||||
return StringUtils.isNotBlank(expression) && StringUtils.isNotBlank(condition) && BooleanUtils.isTrue(this.getEnable());
|
||||
return StringUtils.isNotBlank(expression)
|
||||
&& StringUtils.isNotBlank(condition)
|
||||
&& BooleanUtils.isTrue(this.getEnable()
|
||||
&& !StringUtils.equals(condition, MsAssertionCondition.UNCHECK.name()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue