@Test public void completeTask() { Task task = new Task(TITLE_TEST, DESCRIPTION_TEST); mTaskDetailPresenter = givenTaskDetailPresenter(task.getId()); mTaskDetailPresenter.start(); mTaskDetailPresenter.completeTask(); verify(mTasksRepository).completeTask(task.getId()); verify(mTaskDetailView).showTaskMarkedComplete(); }
@Override public void completeTask() { if (null == mTaskId || mTaskId.isEmpty()) { mTaskDetailView.showMissingTask(); return; } mUseCaseHandler.execute(mCompleteTask, new CompleteTask.RequestValues(mTaskId), new UseCase.UseCaseCallback<CompleteTask.ResponseValue>() { @Override public void onSuccess(CompleteTask.ResponseValue response) { mTaskDetailView.showTaskMarkedComplete(); } @Override public void onError(Error error) { } }); }
TaskDetailPresenter implements TaskDetailContract.Presenter { @Override public void completeTask() { if (null == mTaskId || mTaskId.isEmpty()) { mTaskDetailView.showMissingTask(); return; } mUseCaseHandler.execute(mCompleteTask, new CompleteTask.RequestValues(mTaskId), new UseCase.UseCaseCallback<CompleteTask.ResponseValue>() { @Override public void onSuccess(CompleteTask.ResponseValue response) { mTaskDetailView.showTaskMarkedComplete(); } @Override public void onError(Error error) { } }); } }
TaskDetailPresenter implements TaskDetailContract.Presenter { @Override public void completeTask() { if (null == mTaskId || mTaskId.isEmpty()) { mTaskDetailView.showMissingTask(); return; } mUseCaseHandler.execute(mCompleteTask, new CompleteTask.RequestValues(mTaskId), new UseCase.UseCaseCallback<CompleteTask.ResponseValue>() { @Override public void onSuccess(CompleteTask.ResponseValue response) { mTaskDetailView.showTaskMarkedComplete(); } @Override public void onError(Error error) { } }); } TaskDetailPresenter(@NonNull UseCaseHandler useCaseHandler,
            @Nullable String taskId,
            @NonNull TaskDetailContract.View taskDetailView,
            @NonNull GetTask getTask,
            @NonNull CompleteTask completeTask,
            @NonNull ActivateTask activateTask,
            @NonNull DeleteTask deleteTask); }
TaskDetailPresenter implements TaskDetailContract.Presenter { @Override public void completeTask() { if (null == mTaskId || mTaskId.isEmpty()) { mTaskDetailView.showMissingTask(); return; } mUseCaseHandler.execute(mCompleteTask, new CompleteTask.RequestValues(mTaskId), new UseCase.UseCaseCallback<CompleteTask.ResponseValue>() { @Override public void onSuccess(CompleteTask.ResponseValue response) { mTaskDetailView.showTaskMarkedComplete(); } @Override public void onError(Error error) { } }); } TaskDetailPresenter(@NonNull UseCaseHandler useCaseHandler,
            @Nullable String taskId,
            @NonNull TaskDetailContract.View taskDetailView,
            @NonNull GetTask getTask,
            @NonNull CompleteTask completeTask,
            @NonNull ActivateTask activateTask,
            @NonNull DeleteTask deleteTask); @Override void start(); @Override void editTask(); @Override void deleteTask(); @Override void completeTask(); @Override void activateTask(); }
TaskDetailPresenter implements TaskDetailContract.Presenter { @Override public void completeTask() { if (null == mTaskId || mTaskId.isEmpty()) { mTaskDetailView.showMissingTask(); return; } mUseCaseHandler.execute(mCompleteTask, new CompleteTask.RequestValues(mTaskId), new UseCase.UseCaseCallback<CompleteTask.ResponseValue>() { @Override public void onSuccess(CompleteTask.ResponseValue response) { mTaskDetailView.showTaskMarkedComplete(); } @Override public void onError(Error error) { } }); } TaskDetailPresenter(@NonNull UseCaseHandler useCaseHandler,
            @Nullable String taskId,
            @NonNull TaskDetailContract.View taskDetailView,
            @NonNull GetTask getTask,
            @NonNull CompleteTask completeTask,
            @NonNull ActivateTask activateTask,
            @NonNull DeleteTask deleteTask); @Override void start(); @Override void editTask(); @Override void deleteTask(); @Override void completeTask(); @Override void activateTask();  }