I’m trying to test a Saga. I expect when an event occurs then two commands are dispatched.
The assertion is:
fixture.givenAggregate(INVOICE_ID.toString()) .published(new InvoiceCreated(**...**))
.expectDispatchedCommandsMatching(Matchers.listWithAllOf( Matchers.equalTo(new AcceptInvoice(**....**)), Matchers.equalTo(new BackupInvoice(**....**))
The problem is that I always get this error:
org.axonframework.test.AxonAssertionError: Incorrect dispatched command. Expected <list with all of: <dto.command.AcceptInvoice> (FAILED!) and <dto.command.BackupInvoice>>, but got
Any idea what could be wrong?