TasksPresenter implements TasksContract.Presenter { @Override public void completeTask(@NonNull Task completedTask) { checkNotNull(completedTask, "completedTask cannot be null!"); mTasksRepository.completeTask(completedTask); mTasksView.showTaskMarkedComplete(); loadTasks(false, false); } TasksPresenter(@NonNull TasksRepository tasksRepository, @NonNull TasksContract.View tasksView); @Override void start(); @Override void result(int requestCode, int resultCode); @Override void loadTasks(boolean forceUpdate); @Override void addNewTask(); @Override void openTaskDetails(@NonNull Task requestedTask); @Override void completeTask(@NonNull Task completedTask); @Override void activateTask(@NonNull Task activeTask); @Override void clearCompletedTasks(); @Override void setFiltering(TasksFilterType requestType); @Override TasksFilterType getFiltering();  }
@Test public void completeTask_ShowsTaskMarkedComplete() { Task task = new Task("Details Requested", "For this task"); mTasksPresenter.completeTask(task); verify(mTasksRepository).completeTask(task); verify(mTasksView).showTaskMarkedComplete(); }