Skip to content

Commit

Permalink
Merge branch 'main' of github.com:flowable/flowable-engine
Browse files Browse the repository at this point in the history
  • Loading branch information
tijsrademakers committed Aug 20, 2024
2 parents 6f5fcfa + 3a752cc commit eab1f9c
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.when;

import java.util.Calendar;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -84,12 +86,12 @@ public void resetMocks() {
@Deployment
public void testGetProcessTask() throws Exception {
if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.AUDIT)) {
Calendar now = Calendar.getInstance();
processEngineConfiguration.getClock().setCurrentTime(now.getTime());
Date now = Date.from(Instant.now().truncatedTo(ChronoUnit.SECONDS));
processEngineConfiguration.getClock().setCurrentTime(now);

ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("oneTaskProcess");
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
taskService.setDueDate(task.getId(), now.getTime());
taskService.setDueDate(task.getId(), now);
taskService.setOwner(task.getId(), "owner");
task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
assertThat(task).isNotNull();
Expand Down Expand Up @@ -131,8 +133,8 @@ public void testGetProcessAdhoc() throws Exception {
if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.AUDIT)) {
try {

Calendar now = Calendar.getInstance();
processEngineConfiguration.getClock().setCurrentTime(now.getTime());
Date now = Date.from(Instant.now().truncatedTo(ChronoUnit.SECONDS));
processEngineConfiguration.getClock().setCurrentTime(now);

Task parentTask = taskService.newTask();
taskService.saveTask(parentTask);
Expand All @@ -144,7 +146,7 @@ public void testGetProcessAdhoc() throws Exception {
task.setAssignee("kermit");
task.setDelegationState(DelegationState.RESOLVED);
task.setDescription("Description");
task.setDueDate(now.getTime());
task.setDueDate(now);
task.setOwner("owner");
task.setPriority(20);
taskService.saveTask(task);
Expand Down

0 comments on commit eab1f9c

Please sign in to comment.