Skip to content

Commit

Permalink
fix: [ANDROAPP-6644] correct test
Browse files Browse the repository at this point in the history
xavimolloy authored and mmmateos committed Nov 26, 2024

Partially verified

This commit is signed with the committer’s verified signature.
mmmateos’s contribution has been verified via GPG key.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
1 parent bbfe0bd commit ece4e8a
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.dhis2.commons.date;

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

}
}

0 comments on commit ece4e8a

Please sign in to comment.