Package org.axonframework.quickstart.api

Examples of org.axonframework.quickstart.api.MarkCompletedCommand


    public static void sendCommands(CommandGateway commandGateway) {
        final String itemId1 = UUID.randomUUID().toString();
        final String itemId2 = UUID.randomUUID().toString();
        commandGateway.sendAndWait(new CreateToDoItemCommand(itemId1, "Check if it really works!"));
        commandGateway.sendAndWait(new CreateToDoItemCommand(itemId2, "Think about the next steps!"));
        commandGateway.sendAndWait(new MarkCompletedCommand(itemId1));
    }
View Full Code Here


        this.repository = repository;
    }

    @Override
    public Object handle(CommandMessage<MarkCompletedCommand> commandMessage, UnitOfWork unitOfWork) throws Throwable {
        MarkCompletedCommand command = commandMessage.getPayload();
        ToDoItem toDoItem = repository.load(command.getTodoId());
        toDoItem.markCompleted();
        return toDoItem;
    }
View Full Code Here

    }

    @Test
    public void testMarkToDoItemAsCompleted() throws Exception {
        fixture.given(new ToDoItemCreatedEvent("todo1", "Need to implement the aggregate"))
               .when(new MarkCompletedCommand("todo1"))
               .expectEvents(new ToDoItemCompletedEvent("todo1"));
    }
View Full Code Here

    }

    @Test
    public void testMarkToDoItemAsCompleted() throws Exception {
        fixture.given(new ToDoItemCreatedEvent("todo1", "Need to implement the aggregate"))
               .when(new MarkCompletedCommand("todo1"))
               .expectEvents(new ToDoItemCompletedEvent("todo1"));
    }
View Full Code Here

TOP

Related Classes of org.axonframework.quickstart.api.MarkCompletedCommand

Copyright © 2018 www.massapicom. 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.