Fixing tests

This commit is contained in:
2024-03-18 15:03:42 -05:00
parent 59a4ad7de6
commit 2088c5dab3
2 changed files with 10 additions and 0 deletions

View File

@ -186,11 +186,13 @@ class QScheduleManagerTest extends BaseTest
.withId(2) .withId(2)
.withSchedulerName(QuartzTestUtils.QUARTZ_SCHEDULER_NAME)); .withSchedulerName(QuartzTestUtils.QUARTZ_SCHEDULER_NAME));
qInstance.getQueue(TestUtils.TEST_SQS_QUEUE).setSchedule(null);
qScheduleManager.setupScheduledJob(newScheduledJob(ScheduledJobType.QUEUE_PROCESSOR, qScheduleManager.setupScheduledJob(newScheduledJob(ScheduledJobType.QUEUE_PROCESSOR,
Map.of("queueName", TestUtils.TEST_SQS_QUEUE)) Map.of("queueName", TestUtils.TEST_SQS_QUEUE))
.withId(3) .withId(3)
.withSchedulerName(QuartzTestUtils.QUARTZ_SCHEDULER_NAME)); .withSchedulerName(QuartzTestUtils.QUARTZ_SCHEDULER_NAME));
qInstance.getTable(TestUtils.TABLE_NAME_PERSON_MEMORY).getAutomationDetails().setSchedule(null);
qScheduleManager.setupScheduledJob(newScheduledJob(ScheduledJobType.TABLE_AUTOMATIONS, qScheduleManager.setupScheduledJob(newScheduledJob(ScheduledJobType.TABLE_AUTOMATIONS,
Map.of("tableName", TestUtils.TABLE_NAME_PERSON_MEMORY, "automationStatus", AutomationStatus.PENDING_UPDATE_AUTOMATIONS.name())) Map.of("tableName", TestUtils.TABLE_NAME_PERSON_MEMORY, "automationStatus", AutomationStatus.PENDING_UPDATE_AUTOMATIONS.name()))
.withId(4) .withId(4)

View File

@ -23,6 +23,7 @@ package com.kingsrook.qqq.backend.core.scheduler.quartz.processes;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
import com.kingsrook.qqq.backend.core.BaseTest; import com.kingsrook.qqq.backend.core.BaseTest;
import com.kingsrook.qqq.backend.core.actions.processes.QProcessCallbackFactory; import com.kingsrook.qqq.backend.core.actions.processes.QProcessCallbackFactory;
import com.kingsrook.qqq.backend.core.actions.processes.RunProcessAction; import com.kingsrook.qqq.backend.core.actions.processes.RunProcessAction;
@ -43,6 +44,7 @@ import com.kingsrook.qqq.backend.core.scheduler.QScheduleManager;
import com.kingsrook.qqq.backend.core.scheduler.quartz.QuartzJobAndTriggerWrapper; import com.kingsrook.qqq.backend.core.scheduler.quartz.QuartzJobAndTriggerWrapper;
import com.kingsrook.qqq.backend.core.scheduler.quartz.QuartzScheduler; import com.kingsrook.qqq.backend.core.scheduler.quartz.QuartzScheduler;
import com.kingsrook.qqq.backend.core.scheduler.quartz.QuartzTestUtils; import com.kingsrook.qqq.backend.core.scheduler.quartz.QuartzTestUtils;
import com.kingsrook.qqq.backend.core.utils.SleepUtils;
import com.kingsrook.qqq.backend.core.utils.TestUtils; import com.kingsrook.qqq.backend.core.utils.TestUtils;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
@ -132,6 +134,7 @@ class QuartzJobsProcessTest extends BaseTest
/////////////////////////////// ///////////////////////////////
RunProcessInput input = new RunProcessInput(); RunProcessInput input = new RunProcessInput();
input.setProcessName(PauseAllQuartzJobsProcess.class.getSimpleName()); input.setProcessName(PauseAllQuartzJobsProcess.class.getSimpleName());
input.setFrontendStepBehavior(RunProcessInput.FrontendStepBehavior.SKIP);
new RunProcessAction().execute(input); new RunProcessAction().execute(input);
////////////////////////////////////// //////////////////////////////////////
@ -153,8 +156,11 @@ class QuartzJobsProcessTest extends BaseTest
/////////////////////////////// ///////////////////////////////
RunProcessInput input = new RunProcessInput(); RunProcessInput input = new RunProcessInput();
input.setProcessName(PauseAllQuartzJobsProcess.class.getSimpleName()); input.setProcessName(PauseAllQuartzJobsProcess.class.getSimpleName());
input.setFrontendStepBehavior(RunProcessInput.FrontendStepBehavior.SKIP);
new RunProcessAction().execute(input); new RunProcessAction().execute(input);
SleepUtils.sleep(3, TimeUnit.SECONDS);
////////////////////////////////////// //////////////////////////////////////
// assert everything becomes paused // // assert everything becomes paused //
////////////////////////////////////// //////////////////////////////////////
@ -165,6 +171,7 @@ class QuartzJobsProcessTest extends BaseTest
//////////////////// ////////////////////
input = new RunProcessInput(); input = new RunProcessInput();
input.setProcessName(ResumeAllQuartzJobsProcess.class.getSimpleName()); input.setProcessName(ResumeAllQuartzJobsProcess.class.getSimpleName());
input.setFrontendStepBehavior(RunProcessInput.FrontendStepBehavior.SKIP);
new RunProcessAction().execute(input); new RunProcessAction().execute(input);
//////////////////////////////////////// ////////////////////////////////////////
@ -198,6 +205,7 @@ class QuartzJobsProcessTest extends BaseTest
////////////////////////// //////////////////////////
input = new RunProcessInput(); input = new RunProcessInput();
input.setProcessName(ResumeAllQuartzJobsProcess.class.getSimpleName()); input.setProcessName(ResumeAllQuartzJobsProcess.class.getSimpleName());
input.setFrontendStepBehavior(RunProcessInput.FrontendStepBehavior.SKIP);
new RunProcessAction().execute(input); new RunProcessAction().execute(input);
//////////////////////////////////////// ////////////////////////////////////////