@@ -247,10 +247,12 @@ private AggregateReportDto createAggregateReportDto(
247247 }
248248
249249 @ Test
250- public void testAggregateReportsSummarize () {
250+ public void testAggregateReportsSummarize () throws InterruptedException {
251251 loginWith (informant1 );
252252
253253 createAggregateReport (1 , 1 , 1 , rdcf .region , rdcf .district , null , null );
254+ // changeDate has millisecond resolution, delay so the later report at the same jurisdiction is unambiguously the most recent
255+ Thread .sleep (1 );
254256 createAggregateReport (2 , 2 , 2 , rdcf .region , rdcf .district , null , null );
255257 createAggregateReport (3 , 3 , 3 , rdcf .region , rdcf .district , rdcf .facility , null );
256258
@@ -367,12 +369,14 @@ public void testAggregatereportSummarizeConsidersUpperLevelData() {
367369 }
368370
369371 @ Test
370- public void testAggregateReportGetEditData () {
372+ public void testAggregateReportGetEditData () throws InterruptedException {
371373 useNationalUserLogin ();
372374 Disease disease = Disease .ACUTE_VIRAL_HEPATITIS ;
373375 creator .updateDiseaseConfiguration (disease , false , false , false , true , null , false , 0 , 0 );
374376
375377 createAggregateReport (disease , null , 1 , 1 , 1 );
378+ // changeDate has millisecond resolution, delay so getSimilarAggregateReports unambiguously picks the most recent report per age group
379+ Thread .sleep (1 );
376380 AggregateReportDto selectedAggregateReport = createAggregateReport (disease , null , 2 , 2 , 2 );
377381
378382 List <AggregateReportDto > similarAggregateReports = getAggregateReportFacade ().getSimilarAggregateReports (selectedAggregateReport );
@@ -388,6 +392,8 @@ public void testAggregateReportGetEditData() {
388392 createAggregateReport (disease , "1Y_5Y" , 5 , 5 , 5 );
389393 createAggregateReport (disease , "6Y" , 6 , 6 , 6 );
390394
395+ // delay so the second batch (same age groups, higher values) is unambiguously more recent than the first
396+ Thread .sleep (1 );
391397 createAggregateReport (disease , "0D_28D" , 31 , 31 , 31 );
392398 AggregateReportDto selectedAggregateReport2 = createAggregateReport (disease , "1M_12M" , 41 , 41 , 41 );
393399 createAggregateReport (disease , "1Y_5Y" , 51 , 51 , 51 );
0 commit comments