Package org.axonframework.test.saga
Class CommandValidator
java.lang.Object
org.axonframework.test.saga.CommandValidator
Helper class for validation of dispatched commands.
- Since:
- 1.1
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionCommandValidator(RecordingCommandBus commandBus, FieldFilter fieldFilter) Creates a validator which monitors the givencommandBus. -
Method Summary
Modifier and TypeMethodDescriptionvoidassertDispatchedEqualTo(Object... expected) Assert that the given commands have been dispatched in the exact sequence provided.voidassertDispatchedMatching(org.hamcrest.Matcher<?> matcher) Assert that commands matching the givenmatcherhas been dispatched on the command bus.voidStarts recording commands on the command bus.
-
Constructor Details
-
CommandValidator
Creates a validator which monitors the givencommandBus.- Parameters:
commandBus- the command bus to monitorfieldFilter- the filter describing the Fields to include in a comparison
-
-
Method Details
-
startRecording
public void startRecording()Starts recording commands on the command bus. -
assertDispatchedEqualTo
Assert that the given commands have been dispatched in the exact sequence provided.- Parameters:
expected- The commands expected to have been published on the bus
-
assertDispatchedMatching
public void assertDispatchedMatching(org.hamcrest.Matcher<?> matcher) Assert that commands matching the givenmatcherhas been dispatched on the command bus.- Parameters:
matcher- The matcher validating the actual commands
-