Package org.axonframework.test.fixture
Class CommandValidator
java.lang.Object
org.axonframework.test.fixture.CommandValidator
Helper class for validation of dispatched commands.
- Since:
- 1.1.0
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionCommandValidator(Supplier<List<CommandMessage>> dispatchedCommands, Runnable clearRecordedCommands, FieldFilter fieldFilter) CommandValidator(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 monitor.fieldFilter- The filter describing the Fields to include in a comparison.
-
CommandValidator
public CommandValidator(Supplier<List<CommandMessage>> dispatchedCommands, Runnable clearRecordedCommands, FieldFilter fieldFilter)
-
-
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
-