refactor(接口测试): 批量编辑定时任务增加Corn表达式的非空验证

This commit is contained in:
Jianguo-Genius 2024-11-19 15:39:12 +08:00 committed by Craftsman
parent dff9290030
commit ed98065194
2 changed files with 6 additions and 0 deletions

View File

@ -2559,6 +2559,9 @@ public class ApiScenarioService extends MoveNodeService {
if (StringUtils.isBlank(request.getCron()) && request.getConfig() == null) { if (StringUtils.isBlank(request.getCron()) && request.getConfig() == null) {
this.batchUpdateSchedule(apiScenarios, request.isEnable(), operator); this.batchUpdateSchedule(apiScenarios, request.isEnable(), operator);
} else { } else {
if (StringUtils.isBlank(request.getCron())) {
throw new MSException("Cron can not be null");
}
apiScenarios.forEach(apiScenario -> { apiScenarios.forEach(apiScenario -> {
ScheduleConfig scheduleConfig = ScheduleConfig.builder() ScheduleConfig scheduleConfig = ScheduleConfig.builder()
.resourceId(apiScenario.getId()) .resourceId(apiScenario.getId())

View File

@ -46,6 +46,9 @@ public class TestPlanScheduleService {
scheduleService.updateIfExist(testPlan.getId(), request.isEnable(), TestPlanScheduleJob.getJobKey(testPlan.getId()), scheduleService.updateIfExist(testPlan.getId(), request.isEnable(), TestPlanScheduleJob.getJobKey(testPlan.getId()),
TestPlanScheduleJob.getTriggerKey(testPlan.getId()), TestPlanScheduleJob.class, operator); TestPlanScheduleJob.getTriggerKey(testPlan.getId()), TestPlanScheduleJob.class, operator);
} else { } else {
if (StringUtils.isBlank(request.getCron())) {
throw new MSException("Cron can not be null");
}
ScheduleConfig scheduleConfig = ScheduleConfig.builder() ScheduleConfig scheduleConfig = ScheduleConfig.builder()
.resourceId(testPlan.getId()) .resourceId(testPlan.getId())
.key(testPlan.getId()) .key(testPlan.getId())