What
Integration tests for triggering automation runs, cancelling them, and querying run history. These tests involve async execution — TriggerAutomationReactor returns a run ID immediately and execution happens in the background.
Depends on
#2797 (AutomationTestUtils, including waitForRunCompletion)
Files to create
test/prerna/testing/automation/
TriggerAutomationReactorTests.java
CancelAutomationRunReactorTests.java
AutomationRunHistoryTests.java
Test cases
TriggerAutomationReactorTests
testTriggerReturnsRunIdImmediately — trigger → response has runId + RUNNING or QUEUED status
testTriggerCreatesRunRecord — trigger, wait for completion → getAutomationRun returns full record with timestamps
testTriggerMinimalAutomation — automation with only a trigger node (no action nodes) → completes with COMPLETED status
testTriggerUnknownAutomationIdThrows — random UUID → error
CancelAutomationRunReactorTests
testCancelRunWhileRunning — trigger a slow automation (wait node with short delay), immediately cancel → run ends with CANCELLED status
testCancelAlreadyCompletedRunThrows — complete a run first, then try to cancel → error
testCancelUnknownRunIdThrows — random UUID → error
AutomationRunHistoryTests
testListRunsEmptyBeforeAnyTrigger — fresh automation → empty run list
testListRunsReturnsAllRuns — trigger 3 times, wait for each → list returns 3 records
testGetRunReturnsCorrectStatus — trigger, wait for completion → status is COMPLETED, has start/end timestamps
testGetRunReturnsNodeOutputs — trigger automation with a DB engine node, wait → getAutomationNodeOutputs returns output for that node
testGetRunUnknownIdThrows — random UUID → error
Async handling note
TriggerAutomationReactor submits work to the execution backend and returns immediately. Tests that need to assert on a completed run must use AutomationTestUtils.waitForRunCompletion(automationId, runId, 30) to poll until the run reaches a terminal state.
Important: the polling approach here is independent of the execution backend decision (Temporal vs Quartz). waitForRunCompletion only reads the AUTOMATION_RUNS DB table — whichever backend updates that table on completion, the polling works the same way. No changes to these tests should be needed after #2790 is resolved.
What
Integration tests for triggering automation runs, cancelling them, and querying run history. These tests involve async execution —
TriggerAutomationReactorreturns a run ID immediately and execution happens in the background.Depends on
#2797 (AutomationTestUtils, including
waitForRunCompletion)Files to create
Test cases
TriggerAutomationReactorTests
testTriggerReturnsRunIdImmediately— trigger → response has runId +RUNNINGorQUEUEDstatustestTriggerCreatesRunRecord— trigger, wait for completion →getAutomationRunreturns full record with timestampstestTriggerMinimalAutomation— automation with only a trigger node (no action nodes) → completes withCOMPLETEDstatustestTriggerUnknownAutomationIdThrows— random UUID → errorCancelAutomationRunReactorTests
testCancelRunWhileRunning— trigger a slow automation (wait node with short delay), immediately cancel → run ends withCANCELLEDstatustestCancelAlreadyCompletedRunThrows— complete a run first, then try to cancel → errortestCancelUnknownRunIdThrows— random UUID → errorAutomationRunHistoryTests
testListRunsEmptyBeforeAnyTrigger— fresh automation → empty run listtestListRunsReturnsAllRuns— trigger 3 times, wait for each → list returns 3 recordstestGetRunReturnsCorrectStatus— trigger, wait for completion → status isCOMPLETED, has start/end timestampstestGetRunReturnsNodeOutputs— trigger automation with a DB engine node, wait →getAutomationNodeOutputsreturns output for that nodetestGetRunUnknownIdThrows— random UUID → errorAsync handling note
TriggerAutomationReactorsubmits work to the execution backend and returns immediately. Tests that need to assert on a completed run must useAutomationTestUtils.waitForRunCompletion(automationId, runId, 30)to poll until the run reaches a terminal state.Important: the polling approach here is independent of the execution backend decision (Temporal vs Quartz).
waitForRunCompletiononly reads theAUTOMATION_RUNSDB table — whichever backend updates that table on completion, the polling works the same way. No changes to these tests should be needed after #2790 is resolved.