diff --git a/backend/src/main/java/io/metersphere/api/service/ApiJmeterFileService.java b/backend/src/main/java/io/metersphere/api/service/ApiJmeterFileService.java index a0db59aefe..bc9b9b39e0 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiJmeterFileService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiJmeterFileService.java @@ -60,7 +60,7 @@ public class ApiJmeterFileService { if (StringUtils.isNotEmpty(testPlanScenarioId)) { // 获取场景用例单独的执行环境 TestPlanApiScenario planApiScenario = testPlanApiScenarioMapper.selectByPrimaryKey(testPlanScenarioId); - if(planApiScenario != null){ + if (planApiScenario != null) { String environment = planApiScenario.getEnvironment(); if (StringUtils.isNotBlank(environment)) { planEnvMap = JSON.parseObject(environment, Map.class); @@ -68,9 +68,9 @@ public class ApiJmeterFileService { } } HashTree hashTree; - if (ApiRunMode.DEFINITION.name().equals(runMode) || ApiRunMode.API_PLAN.name().equals(runMode) || ApiRunMode.MANUAL_PLAN.name().equals(runMode)) { + if (StringUtils.equalsAnyIgnoreCase(runMode, ApiRunMode.DEFINITION.name(), ApiRunMode.API_PLAN.name(), ApiRunMode.SCHEDULE_API_PLAN.name(), ApiRunMode.MANUAL_PLAN.name())) { String testId = remoteTestId; - if(remoteTestId.contains(":")){ + if (remoteTestId.contains(":")) { //执行测试计划案例时会有拼接ID,ID为 planTestCaseId:测试计划报告ID testId = remoteTestId.split(":")[0]; }