Feature Request: Add option to set aggregate factory for GivenWhenThen test fixture?

Hi all,

When testing command handlers using aggregate root with Spring-injected resources it would be very convenient to be able to set the aggregate factory of the repository configured by the GivenWhenTestFixture.

Right now we’re using test setup code similar to the following, but it would be nice to be able to configure the aggregate factory directly and to get rid of the reflection:

Hi Bardur,

you can use the method registerRepository() to do so. registerRepository(new EventSourcingRepository(myAggregateFactory)); should do the trick.

But I agree with you that it would be helpful to simply have a registerAggregateFactory method that does this for you. Will do!
Thanks for reporting this.

Cheers,

Allard

Ah, I hadn’t noticed that method. Thanks,