Package org.axonframework.quickstart.api

Examples of org.axonframework.quickstart.api.CreateToDoItemCommand


public class CommandGenerator {

    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<CreateToDoItemCommand> commandMessage, UnitOfWork unitOfWork) throws Throwable {
        CreateToDoItemCommand command = commandMessage.getPayload();
        ToDoItem toDoItem = new ToDoItem(command.getTodoId(), command.getDescription());
        repository.add(toDoItem);
        return toDoItem;
    }
View Full Code Here

    }

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

    }

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

TOP

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

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.