Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mustaphazorgati committed Jul 27, 2023
1 parent 71944c6 commit b123348
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,13 @@ private Instant normalizeDue(Instant due) {
// plusMillis since due is inclusive, but calculation happens exclusive.
// minusMillis since we calculated a due date
// Without that some edge case fail (e.g. due is exactly the start of weekend)
Instant normalize =
taskanaEngine.getEngine().getConfiguration().isUseWorkingTimeCalculation()
? due.plusMillis(1)
: due;
return workingTimeCalculator.subtractWorkingTime(normalize, Duration.ZERO);
if (taskanaEngine.getEngine().getConfiguration().isUseWorkingTimeCalculation()) {
return workingTimeCalculator
.subtractWorkingTime(due.plusMillis(1), Duration.ZERO)
.minusMillis(1);
}

return workingTimeCalculator.subtractWorkingTime(due, Duration.ZERO);
}

private Instant normalizePlanned(Instant instant) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ void should_UpdateTaskPlannedOrDue_When_PlannedOrDueAreOnWeekends_ServiceLevel_P
task = taskService.updateTask(task);
assertThat(task.getPlanned())
.isEqualTo(getInstant("2020-04-09T07:00:00")); // Thursday (skip Good Friday)
assertThat(task.getDue()).isEqualTo(getInstant("2020-04-091:00:00"));
assertThat(task.getDue()).isEqualTo(getInstant("2020-04-09T07:00:00"));

// due changed, planned is null
task.setDue(getInstant("2020-04-11T07:00:00")); // Saturday
Expand Down

0 comments on commit b123348

Please sign in to comment.