[axonframework] How to test an AbstractAggregateRoot? (no eventsourcing)


if you want to publish events from an aggregate, that aggregate must have an identifier. The field annotated with @AggregateIdentifier should not contain a null value.

By the looks of it, you want to have an event sourced aggregate. Since your aggregate extends AbstractAggregateRoot, it doesn’t support event sourcing. Try AbstractAnnotatedAggregateRoot instead. In that case, you won’t need to implement/override getIdentifier() either.