Search in sources :

Example 1 with TaskInputVariablesReadMode

use of org.kie.server.api.model.taskassigning.TaskInputVariablesReadMode in project droolsjbpm-integration by kiegroup.

the class TaskAssigningRuntimeDelegateTest method findTasks.

@Test
public void findTasks() {
    List<String> status = Collections.singletonList(convertToString(Status.Ready));
    List<Status> internalStatus = Collections.singletonList(Status.Ready);
    LocalDateTime lastModificationDate = LocalDateTime.now();
    TaskInputVariablesReadMode mode = TaskInputVariablesReadMode.READ_FOR_ALL;
    TaskDataList taskDataList = new TaskDataList();
    LocalDateTime queryTime = LocalDateTime.now();
    taskDataList.setQueryTime(queryTime);
    when(runtimeClient.findTasks(eq(0L), eq(status), eq(lastModificationDate), anyInt(), anyInt(), eq(mode))).thenReturn(taskDataList);
    TaskAssigningRuntimeDelegate.FindTasksResult result = delegate.findTasks(internalStatus, lastModificationDate, mode);
    verify(runtimeClient).findTasks(eq(0L), eq(status), eq(lastModificationDate), anyInt(), anyInt(), eq(mode));
    assertTrue(result.getTasks().isEmpty());
    assertEquals(queryTime, result.getQueryTime());
}
Also used : Status(org.kie.api.task.model.Status) LocalDateTime(java.time.LocalDateTime) TaskInputVariablesReadMode(org.kie.server.api.model.taskassigning.TaskInputVariablesReadMode) StatusConverter.convertToString(org.kie.server.api.model.taskassigning.util.StatusConverter.convertToString) TaskDataList(org.kie.server.api.model.taskassigning.TaskDataList) Test(org.junit.Test)

Aggregations

LocalDateTime (java.time.LocalDateTime)1 Test (org.junit.Test)1 Status (org.kie.api.task.model.Status)1 TaskDataList (org.kie.server.api.model.taskassigning.TaskDataList)1 TaskInputVariablesReadMode (org.kie.server.api.model.taskassigning.TaskInputVariablesReadMode)1 StatusConverter.convertToString (org.kie.server.api.model.taskassigning.util.StatusConverter.convertToString)1