Skip to content

Commit

Permalink
AAE-24320 Remove condition to check if date difference is negative
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulKumar1606 committed Jul 25, 2024
1 parent 022f8d4 commit 6196864
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public Collection<AuditEventEntity> findAuditsBetweenDates(LocalDate fromDate, L

long daysBetween = ChronoUnit.DAYS.between(fromDate, toDate);

if (daysBetween > 31 || daysBetween < 0) {
throw new IllegalArgumentException("Difference between dates cannot be more than 31 days or negative");
if (daysBetween > 31) {
throw new IllegalArgumentException("Difference between dates cannot be more than 31 days");
}

Long startDateTime = fromDate.atStartOfDay().toEpochSecond(ZoneOffset.UTC);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void should_throw_exception_when_difference_between_dates_is_more_than_31_days()
);

// then
assertEquals("Difference between dates cannot be more than 31 days or negative", thrown.getMessage());
assertEquals("Difference between dates cannot be more than 31 days", thrown.getMessage());
}

@Test
Expand Down

0 comments on commit 6196864

Please sign in to comment.