--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
engine = new InMemoryEventStorageEngine();eventStore = new EmbeddedEventStore(engine);repository = new CachingEventSourcingRepository<>(new GenericAggregateFactory<>(FP.class), eventStore, NoCache.INSTANCE);commandBus = new SimpleCommandBus();
EventHandlingConfiguration ehConfiguration = new EventHandlingConfiguration().usingTrackingProcessors();
configuration = DefaultConfigurer.defaultConfiguration().registerModule(ehConfiguration) .registerCommandHandler(c -> new FPCommandHandler(repository, eventStore)) .configureCommandBus(c -> commandBus) .configureEmbeddedEventStore(c -> engine).configureAggregate(FP.class).buildConfiguration();
configuration.start();
engine = new InMemoryEventStorageEngine();eventStore = new EmbeddedEventStore(engine);repository = new CachingEventSourcingRepository<>(new GenericAggregateFactory<>(FP.class), eventStore, NoCache.INSTANCE);commandBus = new SimpleCommandBus();
EventHandlingConfiguration ehConfiguration = new EventHandlingConfiguration().registerEventHandler(c -> new FPView());
configuration = DefaultConfigurer.defaultConfiguration().registerModule(ehConfiguration) .registerCommandHandler(c -> new FPCommandHandler(repository, eventStore)) .configureCommandBus(c -> commandBus).configureEmbeddedEventStore(c -> engine) .configureAggregate(FP.class).buildConfiguration();
engine = new InMemoryEventStorageEngine();
commandBus = new SimpleCommandBus();
EventHandlingConfiguration ehConfiguration = new EventHandlingConfiguration() .registerEventHandler(c -> new FPView());
configuration = DefaultConfigurer.defaultConfiguration().registerModule(ehConfiguration) .registerCommandHandler(
c -> new FPCommandHandler((repository = new CachingEventSourcingRepository<>( new GenericAggregateFactory<>(FP.class), c.eventStore(), NoCache.INSTANCE)), c.eventStore()))
.configureCommandBus(c -> commandBus).configureEmbeddedEventStore(c -> engine) .configureAggregate(FP.class).buildConfiguration();
//Init
engine = new InMemoryEventStorageEngine();eventStore = new EmbeddedEventStore(engine);
commandBus = new SimpleCommandBus();
//Configuration
EventHandlingConfiguration ehConfiguration = new EventHandlingConfiguration() .registerEventHandler(c -> new FPView());
configuration = DefaultConfigurer.defaultConfiguration()
.configureEventStore(c -> eventStore) .configureAggregate(AggregateConfigurer.defaultConfiguration(FP.class)) .configureCommandBus(c -> commandBus) .registerModule(ehConfiguration) .registerCommandHandler( c -> new FPCommandHandler( c.repository(FP.class), eventStore) ) .buildConfiguration();
configuration.start();
//Retrieve repository and commandGateway objects repository = configuration.repository(FP.class);commandGateway = configuration.commandGateway();
uow = new DefaultUnitOfWork<>(null);uow.start();
commandGateway.sendAndWait(new FPCreateCommand(FPID1));commandGateway.sendAndWait(new FPEnableCommand(FPID1, true));Aggregate<FP> agg = repository.load(FPID1); //right hereassertEquals(true, agg.invoke(FP::isEnabled));
fixture = new AggregateTestFixture<>(FlightObject.class);flightCommandHandler.setRepository(fixture.getRepository());flightCommandHandler.setEventBus(fixture.getEventBus());fixture.registerAnnotatedCommandHandler(flightCommandHandler);fixture.registerInjectableResource(appliAView);
fixture = new AggregateTestFixture<>(FlightObject.class);flightCommandHandler.setRepository(fixture.getRepository());flightCommandHandler.setEventBus(fixture.getEventBus());
fixture.registerInjectableResource(appliAView);
fixture.registerAnnotatedCommandHandler(flightCommandHandler);