Skip to content

Commit

Permalink
fix: [ANDROAPP-6644] resolve code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
xavimolloy authored and mmmateos committed Nov 26, 2024
1 parent 8887820 commit bbfe0bd
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.dhis2.commons.date;

import static org.junit.Assert.assertEquals;
import org.junit.jupiter.api.Assertions;
import org.junit.Test;
import java.util.Calendar;
import java.util.Date;
Expand All @@ -14,13 +14,13 @@ public void returnsEventOverDueDateCorrectly() {
Calendar calendar = Calendar.getInstance();
//should return false for current date
calendar.setTime(new Date());
assertEquals(false, DateUtils.getInstance().isEventDueDateOverdue(calendar.getTime()));
Assertions.assertFalse(DateUtils.getInstance().isEventDueDateOverdue(calendar.getTime()));
//false for future date
calendar.add(Calendar.DAY_OF_MONTH, 10);
assertEquals(false, DateUtils.getInstance().isEventDueDateOverdue(calendar.getTime()));
Assertions.assertFalse(DateUtils.getInstance().isEventDueDateOverdue(calendar.getTime()));
//true for past dates
calendar.add(Calendar.DAY_OF_MONTH, -30);
assertEquals(true, DateUtils.getInstance().isEventDueDateOverdue(calendar.getTime()));
Assertions.assertTrue(DateUtils.getInstance().isEventDueDateOverdue(calendar.getTime()));

}
}

0 comments on commit bbfe0bd

Please sign in to comment.