refactor(接口测试): 批量编辑定时任务增加Corn表达式的非空验证
This commit is contained in:
parent
dff9290030
commit
ed98065194
|
@ -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())
|
||||||
|
|
|
@ -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())
|
||||||
|
|
Loading…
Reference in New Issue