.configureAggregateFactory(c -> beanFactory.getBean(factoryName, AggregateFactory.class)); String triggerDefinition = aggregateAnnotation.snapshotTriggerDefinition(); if (!"".equals(triggerDefinition)) {
@Before public void setUp() { configuration = DefaultConfigurer.defaultConfiguration() .configureEmbeddedEventStore(c -> new InMemoryEventStorageEngine()) .configureAggregate(AggregateConfigurer.defaultConfiguration(MyAggregate.class) .configureAggregateFactory(c -> new AggregateFactory<MyAggregate>() { @Override public MyAggregate createAggregateRoot(String aggregateIdentifier, DomainEventMessage<?> firstEvent) { return new MyAggregate(aggregateIdentifier); } @Override public Class<MyAggregate> getAggregateType() { return MyAggregate.class; } })) .registerCommandHandler(c -> new MyCommandHandler(c.repository(MyAggregate.class), c.commandGateway())) .buildConfiguration(); configuration.start(); command = new MyCommand("outer", aggregateIdentifier, new MyCommand("middle", aggregateIdentifier, new MyCommand("inner", aggregateIdentifier))); }