org.axonframework.test.saga
Class CommandValidator

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

public class CommandValidator
extends Object

Helper class for validation of dispatched commands.

Since:
1.1
Author:
Allard Buijze

Constructor Summary
CommandValidator(RecordingCommandBus commandBus, FieldFilter fieldFilter)
          Creates a validator which monitors the given commandBus.
 
Method Summary
 void assertDispatchedEqualTo(Object... expected)
          Assert that the given commands have been dispatched in the exact sequence provided.
 void assertDispatchedMatching(org.hamcrest.Matcher<?> matcher)
          Assert that commands matching the given matcher has been dispatched on the command bus.
 void startRecording()
          Starts recording commands on the command bus.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

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


Copyright © 2010-2016. All Rights Reserved.