Skip to content

Commit

Permalink
Fix test failing due to millis precision
Browse files Browse the repository at this point in the history
  • Loading branch information
mseaton committed May 6, 2024
1 parent 4e2e588 commit 57d7497
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.notNullValue;
Expand Down Expand Up @@ -118,10 +119,10 @@ public void setUp() throws Exception {
}

@Test
public void integrationTest_ADT_workflow() {
public void integrationTest_ADT_workflow() throws Exception {

ContextSensitiveMetadataTestUtils.setupSupportsVisitLocationTag(locationService);
Date startOfTest = new Date();
Date startOfTest = DateUtils.setMilliseconds(new Date(), 0);

Provider provider = Context.getProviderService().getProvider(1);
Patient patient = Context.getPatientService().getPatient(7);
Expand Down Expand Up @@ -162,7 +163,8 @@ public void integrationTest_ADT_workflow() {
providers.put(Context.getEncounterService().getEncounterRole(1), Collections.singleton(provider));

// step 2: admit the patient (which should create an encounter)
Date admitDatetime = new Date();
Thread.sleep(1000);
Date admitDatetime = DateUtils.setMilliseconds(new Date(), 0);
AdtAction admission = new AdtAction(checkInEncounter.getVisit(), inpatientWard, providers, ADMISSION);
admission.setActionDatetime(admitDatetime);
Encounter admitEncounter = service.createAdtEncounterFor(admission);
Expand All @@ -178,7 +180,7 @@ public void integrationTest_ADT_workflow() {
// TODO transfer the patient within the hospital

// step 3: discharge the patient (which should create an encounter)

Thread.sleep(1000);
AdtAction discharge = new AdtAction(admitEncounter.getVisit(), inpatientWard, providers, DISCHARGE);
Encounter dischargeEncounter = service.createAdtEncounterFor(discharge);

Expand Down

0 comments on commit 57d7497

Please sign in to comment.