Skip to content

Commit

Permalink
Update TaskResourceTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
v1r3n committed Dec 9, 2024
1 parent 0779107 commit f660fcc
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import java.util.List;
import java.util.Map;

import com.netflix.conductor.model.TaskModel;
import com.netflix.conductor.service.WorkflowService;
import org.junit.Before;
import org.junit.Test;
import org.springframework.http.ResponseEntity;
Expand Down Expand Up @@ -47,11 +49,13 @@ public class TaskResourceTest {
private TaskService mockTaskService;

private TaskResource taskResource;
private WorkflowService workflowService;

@Before
public void before() {
this.mockTaskService = mock(TaskService.class);
this.taskResource = new TaskResource(this.mockTaskService);
this.workflowService = mock(WorkflowService.class);
this.taskResource = new TaskResource(this.mockTaskService, this.workflowService);
}

@Test
Expand Down Expand Up @@ -86,7 +90,9 @@ public void testUpdateTask() {
TaskResult taskResult = new TaskResult();
taskResult.setStatus(TaskResult.Status.COMPLETED);
taskResult.setTaskId("123");
when(mockTaskService.updateTask(any(TaskResult.class))).thenReturn("123");
TaskModel taskModel = new TaskModel();
taskModel.setTaskId("123");
when(mockTaskService.updateTask(any(TaskResult.class))).thenReturn(taskModel);
assertEquals("123", taskResource.updateTask(taskResult));
}

Expand Down

0 comments on commit f660fcc

Please sign in to comment.