Class WorkflowTestServices
java.lang.Object
io.axoniq.framework.workflow.runtime.test.fixture.WorkflowTestServices
Aggregates workflow runtime services used by workflow tests.
This type is a small convenience wrapper around AxonConfiguration. It resolves the runtime services that
workflow tests commonly need, such as the WorkflowEngine, test event publication helpers, workflow
configuration registry, and workflow history repository. It also exposes stepping-mode-only services through
Optional, so callers can detect whether the underlying test configuration was started with stepping
support.
- Since:
- 5.4.0
- Author:
- Simon Zambrovski
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName everyWorkflowModulebuilt throughWorkflowTestFixture.workflowModule(Class, ComponentBuilder, ComponentBuilder)is registered under. -
Method Summary
Modifier and TypeMethodDescriptionclock()Returns the stepping-mode test clock when the configuration provides oneReturns the underlying Axon configurationReturns the delayed event publisher used for integration-style test publicationReturns the test event publisher used to inject events into the workflow runtimeReturns the manual execute-step action resolver when the configuration provides onestatic WorkflowTestServicesfrom(AxonConfiguration configuration) Constructs a newWorkflowTestServicesfrom the givenAxonConfiguration.static WorkflowTestServicesfrom(AxonConfiguration configuration, String moduleName) Constructs a newWorkflowTestServicesfrom the givenAxonConfiguration, using the givenmoduleNameas the name for theWorkflowModuleunder test.voidshutdown()Shuts down the workflow test services and clears recorded workflow historyReturns the manual workflow scheduler when the configuration provides oneReturns the workflow cancellation service available to the test runtimeReturns the workflow engine used by the test runtimeReturns the workflow history repository used by the test runtimeReturns the workflow configuration registry available to the test runtime
-
Field Details
-
DEFAULT_MODULE_NAME
Name everyWorkflowModulebuilt throughWorkflowTestFixture.workflowModule(Class, ComponentBuilder, ComponentBuilder)is registered under.- See Also:
-
-
Method Details
-
from
Constructs a newWorkflowTestServicesfrom the givenAxonConfiguration.- Parameters:
configuration- configuration to use- Returns:
- initialized services
-
from
Constructs a newWorkflowTestServicesfrom the givenAxonConfiguration, using the givenmoduleNameas the name for theWorkflowModuleunder test.- Parameters:
configuration- configuration to usemoduleName- name of theWorkflowModuleunder test- Returns:
- initialized services
-
configuration
Returns the underlying Axon configuration- Returns:
- configuration backing these test services
-
workflowEngine
Returns the workflow engine used by the test runtime- Returns:
- workflow engine
-
delayedPublisher
Returns the delayed event publisher used for integration-style test publication- Returns:
- delayed publisher
-
eventPublisher
Returns the test event publisher used to inject events into the workflow runtime- Returns:
- test event publisher
-
workflowRegistry
Returns the workflow configuration registry available to the test runtime- Returns:
- workflow configuration registry
-
workflowCancellationService
Returns the workflow cancellation service available to the test runtime- Returns:
- workflow cancellation service
-
workflowHistoryRepository
Returns the workflow history repository used by the test runtime- Returns:
- workflow history repository
-
clock
Returns the stepping-mode test clock when the configuration provides one- Returns:
- optional mutable test clock
-
executeStepActionResolver
Returns the manual execute-step action resolver when the configuration provides one- Returns:
- optional manual execute-step action resolver
-
timeoutScheduler
Returns the manual workflow scheduler when the configuration provides one- Returns:
- optional manual workflow scheduler
-
shutdown
public void shutdown()Shuts down the workflow test services and clears recorded workflow history
-