Class PersistentTaskTestService
java.lang.Object
org.sterl.spring.persistent_tasks.test.PersistentTaskTestService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
assertHasNextTask
(TriggerStatus status, TriggerKey key) Runs the next trigger and ensures where is one.void
void
void
Just waits for the current running triggersawaitRunningTriggers
(Duration duration) Just waits for the current running triggersawaitTriggers
(Duration duration, List<Future<TriggerKey>> running) int
boolean
runAllDueTrigger
(OffsetDateTime dueUntil) Runs all triggers which are due until the given time.Runs just the next trigger, if it is due to run.Triggers the execution of all pending triggers.Triggers the execution of all pending triggers and wait for the result.scheduleNextTriggersAndWait
(Duration maxWaitTime) Triggers the execution of all pending triggers and wait for the result.
-
Constructor Details
-
PersistentTaskTestService
public PersistentTaskTestService()
-
-
Method Details
-
runNextTrigger
Runs just the next trigger, if it is due to run.- Returns:
- next
TriggerKey
if found
-
runAllDueTrigger
Runs all triggers which are due until the given time. One by one, so new triggers are picked up.- Parameters:
dueUntil
- date to also check for trigger in the future- Returns:
- the triggers executed, to directly check if they have been successful
-
scheduleNextTriggers
Triggers the execution of all pending triggers. We also add one second to ensure we select all right now created triggers too.- Returns:
- the reference to the
TriggerKey
of the running tasks
-
assertHasScheduler
public void assertHasScheduler() -
scheduleNextTriggersAndWait
Triggers the execution of all pending triggers and wait for the result. -
scheduleNextTriggersAndWait
Triggers the execution of all pending triggers and wait for the result. -
awaitRunningTriggers
Just waits for the current running triggers- Returns:
- return the keys of the currently scheduled triggers
-
awaitRunningTriggers
Just waits for the current running triggers- Parameters:
duration
- how long to wait- Returns:
- return the keys of the currently scheduled triggers
-
awaitTriggers
public ArrayList<TriggerKey> awaitTriggers(Duration duration, List<Future<TriggerKey>> running) throws Throwable - Throws:
Throwable
-
countRunningTriggers
public int countRunningTriggers() -
hasRunningTriggers
public boolean hasRunningTriggers() -
assertNoMoreTriggers
public void assertNoMoreTriggers() -
assertNextTaskSuccess
public void assertNextTaskSuccess() -
assertHasNextTask
public void assertHasNextTask() -
assertHasNextTask
Runs the next trigger and ensures where is one.Note: Failed triggers, which have retries left will be in WAITING state
- Parameters:
status
- optional status to checkkey
- optional key to check
-