Class CommandValidator

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

public class CommandValidator extends Object
Helper class for validation of dispatched commands.
Since:
1.1
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
  • 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