fix(接口测试): 创建场景报错

--user=郭雨琦
接口自动化更多操作创建场景报错
This commit is contained in:
guoyuqi 2022-04-15 10:25:08 +08:00 committed by TIanyang
parent 3c8abbdc58
commit 65299e287a
3 changed files with 7 additions and 2 deletions

View File

@ -151,7 +151,7 @@ public class JMeterService {
}
}
private synchronized void send(JmeterRunRequestDTO request, List<TestResource> resources) {
private void send(JmeterRunRequestDTO request, List<TestResource> resources) {
try {
if (StringUtils.isNotEmpty(request.getPoolId()) && CollectionUtils.isEmpty(resources)) {
resources = GenerateHashTreeUtil.setPoolResource(request.getPoolId());

View File

@ -236,6 +236,11 @@ public class ApiAutomationService {
public ApiScenario create(SaveApiScenarioRequest request, List<MultipartFile> bodyFiles, List<MultipartFile> 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())) {

View File

@ -255,7 +255,7 @@
this.$emit('saveAsEdit', data);
},
refresh() {
this.$emit("refreshTable");
this.$emit("refreshAll");
},
addScenario() {
if (!this.projectId) {