fix(项目设置): 公共脚本重名校验有误
This commit is contained in:
parent
bc63de118d
commit
d3c02a4264
|
@ -53,7 +53,7 @@ public abstract class ScriptProcessorConverter extends MsProcessorConverter<Scri
|
|||
scriptLanguage = scriptProcessor.getCommonScriptInfo().getScriptLanguage();
|
||||
script = scriptProcessor.getCommonScriptInfo().getScript();
|
||||
}
|
||||
if (scriptLanguage == null) {
|
||||
if (scriptLanguage == null || StringUtils.equalsIgnoreCase(scriptLanguage, ScriptLanguageType.BEANSHELL_JSR233.name())) {
|
||||
scriptLanguage = ScriptLanguageType.BEANSHELL.name();
|
||||
}
|
||||
testElement.setProperty(JmeterProperty.SCRIPT, script);
|
||||
|
|
|
@ -147,6 +147,7 @@ public class CustomFunctionService {
|
|||
private void checkAddExist(CustomFunction customFunction) {
|
||||
CustomFunctionExample example = new CustomFunctionExample();
|
||||
example.createCriteria()
|
||||
.andProjectIdEqualTo(customFunction.getProjectId())
|
||||
.andNameEqualTo(customFunction.getName());
|
||||
if (customFunctionMapper.countByExample(example) > 0) {
|
||||
throw new MSException(ProjectResultCode.CUSTOM_FUNCTION_ALREADY_EXIST);
|
||||
|
@ -156,6 +157,7 @@ public class CustomFunctionService {
|
|||
private void checkUpdateExist(CustomFunction customFunction) {
|
||||
CustomFunctionExample example = new CustomFunctionExample();
|
||||
example.createCriteria()
|
||||
.andProjectIdEqualTo(customFunction.getProjectId())
|
||||
.andIdNotEqualTo(customFunction.getId())
|
||||
.andNameEqualTo(customFunction.getName());
|
||||
if (customFunctionMapper.countByExample(example) > 0) {
|
||||
|
|
Loading…
Reference in New Issue