diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java index d6b73cc520..6e9de4f474 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java @@ -60,7 +60,7 @@ public class MsScenario extends MsTestElement { return; } config.setStep(this.name); - + config.setStepType(""); config.setEnableCookieShare(enableCookieShare); if (StringUtils.isNotEmpty(environmentId)) { ApiTestEnvironmentService environmentService = CommonBeanFactory.getBean(ApiTestEnvironmentService.class); diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/ParameterConfig.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/ParameterConfig.java index 6f75a54fb6..345d80efcd 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/ParameterConfig.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/ParameterConfig.java @@ -17,6 +17,6 @@ public class ParameterConfig { // 步骤 private String step; - private final String stepType = "STEP_GROUP"; + private String stepType; } diff --git a/backend/src/main/java/io/metersphere/api/service/HistoricalDataUpgradeService.java b/backend/src/main/java/io/metersphere/api/service/HistoricalDataUpgradeService.java index 489f5b5133..5190ba6dbd 100644 --- a/backend/src/main/java/io/metersphere/api/service/HistoricalDataUpgradeService.java +++ b/backend/src/main/java/io/metersphere/api/service/HistoricalDataUpgradeService.java @@ -185,6 +185,9 @@ public class HistoricalDataUpgradeService { CollectionUtils.isNotEmpty(request.getAssertions().getRegex()) || CollectionUtils.isNotEmpty(request.getAssertions().getXpath2()))) { String assertions = JSON.toJSONString(request.getAssertions()); MsAssertions msAssertions = JSON.parseObject(assertions, MsAssertions.class); + if (StringUtils.isEmpty(msAssertions.getName())) { + msAssertions.setName("Assertions"); + } msAssertions.setType("Assertions"); msAssertions.setIndex(index + ""); msAssertions.setResourceId(UUID.randomUUID().toString()); @@ -196,6 +199,9 @@ public class HistoricalDataUpgradeService { CollectionUtils.isNotEmpty(request.getExtract().getRegex()) || CollectionUtils.isNotEmpty(request.getExtract().getXpath()))) { String extractJson = JSON.toJSONString(request.getExtract()); MsExtract extract = JSON.parseObject(extractJson, MsExtract.class); + if (StringUtils.isEmpty(extract.getName())) { + extract.setName("Extract"); + } extract.setType("Extract"); extract.setIndex(index + ""); extract.setHashTree(new LinkedList<>()); @@ -206,6 +212,9 @@ public class HistoricalDataUpgradeService { if (request.getJsr223PreProcessor() != null && StringUtils.isNotEmpty(request.getJsr223PreProcessor().getScript())) { String preJson = JSON.toJSONString(request.getJsr223PreProcessor()); MsJSR223PreProcessor preProcessor = JSON.parseObject(preJson, MsJSR223PreProcessor.class); + if (StringUtils.isEmpty(preProcessor.getName())) { + preProcessor.setName("JSR223PreProcessor"); + } preProcessor.setType("JSR223PreProcessor"); preProcessor.setIndex(index + ""); preProcessor.setHashTree(new LinkedList<>()); @@ -216,6 +225,9 @@ public class HistoricalDataUpgradeService { if (request.getJsr223PostProcessor() != null && StringUtils.isNotEmpty(request.getJsr223PostProcessor().getScript())) { String preJson = JSON.toJSONString(request.getJsr223PostProcessor()); MsJSR223PostProcessor preProcessor = JSON.parseObject(preJson, MsJSR223PostProcessor.class); + if (StringUtils.isEmpty(preProcessor.getName())) { + preProcessor.setName("JSR223PostProcessor"); + } preProcessor.setType("JSR223PostProcessor"); preProcessor.setIndex(index + ""); preProcessor.setHashTree(new LinkedList<>());