Class WorkflowTestSteppingModeEnhancer
- All Implemented Interfaces:
ConfigurationEnhancer
Stepping mode is intended for fixture-style workflow tests where the test should control when an
execute(...) step finishes and when scheduled workflow work becomes due. Instead of letting the runtime run
execute-step actions and time-based tasks immediately, this enhancer installs test doubles that pause those
transitions until the test explicitly releases them.
This enhancer registers three key components:
- a
ManualExecuteStepActionResolver, exposed as the runtimeExecuteStepActionResolver, so execute steps block until the test supplies either the original action or a test action for the step name - a mutable
TestClock, exposed as the runtimeClock, so workflow time can be advanced deterministically by the test - a
ManualWorkflowScheduler, exposed as the runtimeWorkflowScheduler, so scheduled work runs only when the test advances time and triggers due tasks
Use this enhancer when building custom test configurations that need the same stepping behavior as
WorkflowTestDriver.stepper(io.axoniq.framework.workflow.configuration.WorkflowModule, boolean, java.util.function.UnaryOperator) or WorkflowTestFixture.
Those higher-level APIs already register this enhancer automatically. Register it directly only when you are wiring
the workflow test configuration yourself.
- Since:
- 5.4.0
- Author:
- Simon Zambrovski
-
Constructor Details
-
WorkflowTestSteppingModeEnhancer
public WorkflowTestSteppingModeEnhancer()
-
-
Method Details
-
enhance
Description copied from interface:ConfigurationEnhancer- Specified by:
enhancein interfaceConfigurationEnhancer- Parameters:
registry- The registry instance to enhance.
-