From 36e524e2497b960826bf4ae6615f855915ef9111 Mon Sep 17 00:00:00 2001 From: mogoodrich Date: Thu, 17 Oct 2024 20:53:42 -0400 Subject: [PATCH] fix maternal service test --- .../module/emrapi/maternal/MaternalServiceImplTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/test/java/org/openmrs/module/emrapi/maternal/MaternalServiceImplTest.java b/api/src/test/java/org/openmrs/module/emrapi/maternal/MaternalServiceImplTest.java index eeb50122..81a6f5e3 100644 --- a/api/src/test/java/org/openmrs/module/emrapi/maternal/MaternalServiceImplTest.java +++ b/api/src/test/java/org/openmrs/module/emrapi/maternal/MaternalServiceImplTest.java @@ -169,7 +169,7 @@ public void shouldNotGetChildByMotherIfChildNotLinkedByMotherChildRelationship() @Test public void shouldNotGetChildByMotherIfChildBornADayOrMoreBeforeVisitAndChildBornDuringMothersActiveVisitSetTrue() { - Date oneHourAgo = new DateTime().minusHours(1).toDate(); + Date now = new Date(); Date oneDayAgo = new DateTime().minusDays(1).toDate(); Location visitLocation = testDataManager.location().name("Visit Location").save(); @@ -183,7 +183,7 @@ public void shouldNotGetChildByMotherIfChildBornADayOrMoreBeforeVisitAndChildBor motherChildRelationship.setPersonB(child); personService.saveRelationship(motherChildRelationship); - Visit motherVisit = testDataManager.visit().visitType(emrApiProperties.getAtFacilityVisitType()).location(visitLocation).patient(mother).started(oneHourAgo).save(); + Visit motherVisit = testDataManager.visit().visitType(emrApiProperties.getAtFacilityVisitType()).location(visitLocation).patient(mother).started(now).save(); List motherAndChildList = maternalService.getMothersAndChildren(new MothersAndChildrenSearchCriteria(Collections.singletonList(mother.getUuid()), null, false, false, true));