Skip to content

Commit 59ec115

Browse files
committed
Handle situation where daysBetween is zero.
1 parent bce7706 commit 59ec115

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/test/java/com/objectcomputing/checkins/services/fixture/FeedbackRequestFixture.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ default LocalDate getRandomLocalDateTime(LocalDateTime start, LocalDateTime end)
6262
LocalDate startDate = start.toLocalDate();
6363
long daysBetween = ChronoUnit.DAYS.between(startDate, end.toLocalDate());
6464
Random random = new Random();
65-
long randomDays = random.nextLong(daysBetween);
65+
long randomDays = daysBetween > 0 ? random.nextLong(daysBetween) : 0;
6666

6767
return startDate.plusDays(randomDays);
6868
}

0 commit comments

Comments
 (0)