*
* @param matcher The matcher validating the actual commands
*/
public void assertDispatchedMatching(Matcher<?> matcher) {
if (!matcher.matches(commandBus.getDispatchedCommands())) {
Description expectedDescription = new StringDescription();
Description actualDescription = new StringDescription();
matcher.describeTo(expectedDescription);
describe(commandBus.getDispatchedCommands(), actualDescription);
throw new AxonAssertionError(format("Incorrect dispatched command. Expected <%s>, but got <%s>",
expectedDescription, actualDescription));
}