One command impact multiple aggregates

Hello,
We have a use case where a parent aggregate creates or updates several child aggregates like an orchestrator, starting several long-term processes including human interaction.
As far as I know, it hard to unit test command on child aggregates.
https://discuss-next.axoniq.io/t/how-to-test-2-different-aggregate/

But production code supports it:

What would be the best practices to unit test that aggregate creation we see in the code ?

Regards, Nicolas.

Hello Nicolas,

ultimately, the only thing that survives is the events that were produced. In your test fixture, you should be able to verify the fact that events were created, even if these events are intended to make the beginning of a lifecycle of another aggregate.

Normally, test fixtures only need you to provide the payload of events. Axon will fill in the aggregate identifier and sequence numbers for these events. In this case, you may want to explicitly provide a GenericDomainEventMessage in the fixture to ensure the aggregate identifier and sequence number (always 0 for creation events) are set correctly.

Hope this helps.