TaskRuntimeImpl implements TaskRuntime { @Override public Task update(UpdateTaskPayload updateTaskPayload) { return taskRuntimeHelper.applyUpdateTaskPayload(false, updateTaskPayload); } TaskRuntimeImpl(TaskService taskService,
                           SecurityManager securityManager,
                           APITaskConverter taskConverter,
                           APIVariableInstanceConverter variableInstanceConverter,
                           TaskRuntimeConfiguration configuration,
                           TaskRuntimeHelper taskRuntimeHelper); @Override TaskRuntimeConfiguration configuration(); @Override Task task(String taskId); @Override Page<Task> tasks(Pageable pageable); @Override Page<Task> tasks(Pageable pageable,
                            GetTasksPayload getTasksPayload); @Override Task complete(CompleteTaskPayload completeTaskPayload); @Override Task claim(ClaimTaskPayload claimTaskPayload); @Override Task release(ReleaseTaskPayload releaseTaskPayload); @Override Task update(UpdateTaskPayload updateTaskPayload); @Override Task delete(DeleteTaskPayload deleteTaskPayload); @Override Task create(CreateTaskPayload createTaskPayload); @Override void addCandidateUsers(CandidateUsersPayload candidateUsersPayload); @Override void deleteCandidateUsers(CandidateUsersPayload candidateUsersPayload); @Override void addCandidateGroups(CandidateGroupsPayload candidateGroupsPayload); @Override void deleteCandidateGroups(CandidateGroupsPayload candidateGroupsPayload); @Override List<String> userCandidates(String taskId); @Override List<String> groupCandidates(String taskId); @Override List<VariableInstance> variables(GetTaskVariablesPayload getTaskVariablesPayload); @Override void createVariable(CreateTaskVariablePayload createTaskVariablePayload); @Override void updateVariable(UpdateTaskVariablePayload updateTaskVariablePayload); @Override void save(SaveTaskPayload saveTaskPayload); @Override Task assign(AssignTaskPayload assignTaskPayload);  }
@Test public void should_returnResultOfHelper_when_updateTask() { UpdateTaskPayload updateTaskPayload = TaskPayloadBuilder .update() .withTaskId("taskId") .withDescription("new description") .build(); TaskImpl updatedTask = new TaskImpl(); given(taskRuntimeHelper.applyUpdateTaskPayload(false, updateTaskPayload)).willReturn(updatedTask); Task retrievedTask = taskRuntime.update(updateTaskPayload); assertThat(retrievedTask).isEqualTo(updatedTask); }