From 8fe472a8d2373326a7e1f697d9ea6bf6280ef64e Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 15 Apr 2022 10:25:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=9C=BA=E6=99=AF=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 接口自动化更多操作创建场景报错 --- .../main/java/io/metersphere/api/jmeter/JMeterService.java | 2 +- .../io/metersphere/api/service/ApiAutomationService.java | 5 +++++ .../components/api/automation/scenario/ApiScenarioModule.vue | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/jmeter/JMeterService.java b/backend/src/main/java/io/metersphere/api/jmeter/JMeterService.java index f858a93946..2eecb3c40f 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/JMeterService.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/JMeterService.java @@ -151,7 +151,7 @@ public class JMeterService { } } - private synchronized void send(JmeterRunRequestDTO request, List resources) { + private void send(JmeterRunRequestDTO request, List resources) { try { if (StringUtils.isNotEmpty(request.getPoolId()) && CollectionUtils.isEmpty(resources)) { resources = GenerateHashTreeUtil.setPoolResource(request.getPoolId()); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index 25e0f13086..c8a1155b04 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -236,6 +236,11 @@ public class ApiAutomationService { public ApiScenario create(SaveApiScenarioRequest request, List bodyFiles, List scenarioFiles) { checkQuota(); request.setId(UUID.randomUUID().toString()); + if (request.getScenarioDefinition() == null) { + MsScenario msScenario = new MsScenario(); + msScenario.setHashTree(new LinkedList<>()); + request.setScenarioDefinition(msScenario); + } checkNameExist(request); int nextNum = getNextNum(request.getProjectId()); if (StringUtils.isBlank(request.getCustomNum())) { diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue index 37221f80fa..246bb16fab 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue @@ -255,7 +255,7 @@ this.$emit('saveAsEdit', data); }, refresh() { - this.$emit("refreshTable"); + this.$emit("refreshAll"); }, addScenario() { if (!this.projectId) {