diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/MsAssertions.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/MsAssertions.java index b9d28f7cc4..97510aec1c 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/MsAssertions.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/MsAssertions.java @@ -142,7 +142,14 @@ public class MsAssertions extends MsTestElement { assertion.setProperty(TestElement.TEST_CLASS, JSR223Assertion.class.getName()); assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TestBeanGUI")); assertion.setProperty("cacheKey", "true"); - assertion.setProperty("scriptLanguage", assertionJSR223.getScriptLanguage()); + String scriptLanguage = assertionJSR223.getScriptLanguage(); + if (StringUtils.equals(scriptLanguage, "nashornScript")) { + scriptLanguage = "nashorn"; + } + if (StringUtils.equals(scriptLanguage, "rhinoScript")) { + scriptLanguage = "rhino"; + } + assertion.setProperty("scriptLanguage", scriptLanguage); assertion.setProperty("script", assertionJSR223.getScript()); return assertion; } diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/MsJSR223Processor.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/MsJSR223Processor.java index 66bfed1007..ee2a15aa6d 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/MsJSR223Processor.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/MsJSR223Processor.java @@ -84,7 +84,7 @@ public class MsJSR223Processor extends MsTestElement { processor.setProperty("scriptLanguage", "nashorn"); } if (StringUtils.isNotEmpty(this.getScriptLanguage()) && this.getScriptLanguage().equals("rhinoScript")) { - processor.setProperty("scriptLanguage", "javascript"); + processor.setProperty("scriptLanguage", "rhino"); } processor.setProperty("script", this.getScript()); diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/post/MsJSR223PostProcessor.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/post/MsJSR223PostProcessor.java index ebd57596a0..ed667e79be 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/post/MsJSR223PostProcessor.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/post/MsJSR223PostProcessor.java @@ -71,7 +71,7 @@ public class MsJSR223PostProcessor extends MsTestElement { processor.setProperty("scriptLanguage", "nashorn"); } if (StringUtils.isNotEmpty(this.getScriptLanguage()) && this.getScriptLanguage().equals("rhinoScript")) { - processor.setProperty("scriptLanguage", "javascript"); + processor.setProperty("scriptLanguage", "rhino"); } processor.setProperty("script", this.getScript()); diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/pre/MsJSR223PreProcessor.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/pre/MsJSR223PreProcessor.java index 109ca2049e..edf1ab8a28 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/pre/MsJSR223PreProcessor.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/pre/MsJSR223PreProcessor.java @@ -81,7 +81,7 @@ public class MsJSR223PreProcessor extends MsTestElement { processor.setProperty("scriptLanguage", "nashorn"); } if (StringUtils.isNotEmpty(this.getScriptLanguage()) && this.getScriptLanguage().equals("rhinoScript")) { - processor.setProperty("scriptLanguage", "javascript"); + processor.setProperty("scriptLanguage", "rhino"); } processor.setProperty("script", this.getScript());