Class CommandValidator

java.lang.Object
org.axonframework.test.fixture.CommandValidator

public class CommandValidator extends Object
Helper class for validation of dispatched commands.
Since:
1.1.0
Author:
Allard Buijze
  • Constructor Details

    • CommandValidator

      public CommandValidator(RecordingCommandBus commandBus, FieldFilter fieldFilter)
      Creates a validator which monitors the given commandBus.
      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

      public void assertDispatchedEqualTo(Object... expected)
      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 given matcher has been dispatched on the command bus.
      Parameters:
      matcher - The matcher validating the actual commands