Examples of commitEvents()


Examples of org.axonframework.domain.StubAggregate.commitEvents()

    @Test
    public void testInitializeFromAggregateSnapshot() {
        StubAggregate aggregate = new StubAggregate("stubId");
        aggregate.doSomething();
        aggregate.commitEvents();
        DomainEventMessage<StubAggregate> snapshotMessage = new GenericDomainEventMessage<StubAggregate>(
                aggregate.getIdentifier(), aggregate.getVersion(), aggregate);
        GenericAggregateFactory<StubAggregate> factory = new GenericAggregateFactory<StubAggregate>(StubAggregate.class);
        assertEquals("StubAggregate", factory.getTypeIdentifier());
        assertSame(aggregate, factory.createAggregate(aggregate.getIdentifier(), snapshotMessage));
View Full Code Here

Examples of org.axonframework.domain.StubAggregate.commitEvents()

    @Test
    public void testCreateSnapshot_FirstEventLoadedIsSnapshotEvent() {
        UUID aggregateIdentifier = UUID.randomUUID();
        StubAggregate aggregate = new StubAggregate(aggregateIdentifier);
        aggregate.doSomething();
        aggregate.commitEvents();

        DomainEventMessage<StubAggregate> first =
                new GenericDomainEventMessage<StubAggregate>(
                        aggregate.getIdentifier(), aggregate.getVersion(), aggregate);
        DomainEventMessage secondEvent = new GenericDomainEventMessage<String>(aggregateIdentifier, (long) 0,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.