42434445464748
apply(new ToDoItemCreatedEvent(command.getTodoId(), command.getDescription())); } @CommandHandler public void markCompleted(MarkCompletedCommand command) { apply(new ToDoItemCompletedEvent(command.getTodoId())); }
51525354555657
@Test public void testMarkToDoItemAsCompleted() throws Exception { fixture.given(new ToDoItemCreatedEvent("todo1", "Need to implement the aggregate")) .when(new MarkCompletedCommand("todo1")) .expectEvents(new ToDoItemCompletedEvent("todo1")); }
45464748495051