@Test public void completingTaskDefinitionWithEmptyTitleAndDescriptionDoesNotUpdateState() { AddEditTaskModel updatingATask = AddEditTaskModel.builder() .mode(AddEditTaskMode.update("123")) .details(TaskDetails.create("T1", "This is a task")) .build(); updateSpec .given(updatingATask) .when(taskDefinitionCompleted("", " ")) .then(assertThatNext(hasNoModel(), hasEffects(notifyEmptyTaskNotAllowed()))); }
@Nonnull public static Next<AddEditTaskModel, AddEditTaskEffect> update( AddEditTaskModel model, AddEditTaskEvent event) { return event.map( taskDefinitionCompleted -> onTaskDefinitionCompleted(model, taskDefinitionCompleted), taskCreatedSuccessfully -> exitWithSuccess(), taskCreationFailed -> exitWithFailure(), taskUpdatedSuccessfully -> exitWithSuccess(), taskUpdateFailed -> exitWithFailure()); }
AddEditTaskLogic { @Nonnull public static Next<AddEditTaskModel, AddEditTaskEffect> update( AddEditTaskModel model, AddEditTaskEvent event) { return event.map( taskDefinitionCompleted -> onTaskDefinitionCompleted(model, taskDefinitionCompleted), taskCreatedSuccessfully -> exitWithSuccess(), taskCreationFailed -> exitWithFailure(), taskUpdatedSuccessfully -> exitWithSuccess(), taskUpdateFailed -> exitWithFailure()); } }
AddEditTaskLogic { @Nonnull public static Next<AddEditTaskModel, AddEditTaskEffect> update( AddEditTaskModel model, AddEditTaskEvent event) { return event.map( taskDefinitionCompleted -> onTaskDefinitionCompleted(model, taskDefinitionCompleted), taskCreatedSuccessfully -> exitWithSuccess(), taskCreationFailed -> exitWithFailure(), taskUpdatedSuccessfully -> exitWithSuccess(), taskUpdateFailed -> exitWithFailure()); }  }
AddEditTaskLogic { @Nonnull public static Next<AddEditTaskModel, AddEditTaskEffect> update( AddEditTaskModel model, AddEditTaskEvent event) { return event.map( taskDefinitionCompleted -> onTaskDefinitionCompleted(model, taskDefinitionCompleted), taskCreatedSuccessfully -> exitWithSuccess(), taskCreationFailed -> exitWithFailure(), taskUpdatedSuccessfully -> exitWithSuccess(), taskUpdateFailed -> exitWithFailure()); }  @Nonnull static Next<AddEditTaskModel, AddEditTaskEffect> update(
      AddEditTaskModel model, AddEditTaskEvent event); }
AddEditTaskLogic { @Nonnull public static Next<AddEditTaskModel, AddEditTaskEffect> update( AddEditTaskModel model, AddEditTaskEvent event) { return event.map( taskDefinitionCompleted -> onTaskDefinitionCompleted(model, taskDefinitionCompleted), taskCreatedSuccessfully -> exitWithSuccess(), taskCreationFailed -> exitWithFailure(), taskUpdatedSuccessfully -> exitWithSuccess(), taskUpdateFailed -> exitWithFailure()); }  @Nonnull static Next<AddEditTaskModel, AddEditTaskEffect> update(
      AddEditTaskModel model, AddEditTaskEvent event);  }