diff --git a/src/main/java/org/gcube/dataharvest/utils/DateUtils.java b/src/main/java/org/gcube/dataharvest/utils/DateUtils.java index 9898fd7..36ebd54 100644 --- a/src/main/java/org/gcube/dataharvest/utils/DateUtils.java +++ b/src/main/java/org/gcube/dataharvest/utils/DateUtils.java @@ -95,6 +95,7 @@ public class DateUtils { Calendar aggregationEndDate = getUTCCalendarInstance(); aggregationEndDate.setTimeInMillis(startDate.getTime()); aggregationEndDate.add(aggregationType.getCalendarField(), offset); + aggregationEndDate.add(Calendar.MILLISECOND, -1); return aggregationEndDate.getTime(); } diff --git a/src/test/java/org/gcube/dataharvest/AccountingDataHarvesterPluginTest.java b/src/test/java/org/gcube/dataharvest/AccountingDataHarvesterPluginTest.java index 95068c1..0760472 100644 --- a/src/test/java/org/gcube/dataharvest/AccountingDataHarvesterPluginTest.java +++ b/src/test/java/org/gcube/dataharvest/AccountingDataHarvesterPluginTest.java @@ -59,7 +59,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest { inputs.put(AccountingDataHarvesterPlugin.MEASURE_TYPE_INPUT_PARAMETER, measureType.name()); inputs.put(AccountingDataHarvesterPlugin.RERUN_INPUT_PARAMETER, true); - inputs.put(AccountingDataHarvesterPlugin.DRY_RUN_INPUT_PARAMETER, true); + inputs.put(AccountingDataHarvesterPlugin.DRY_RUN_INPUT_PARAMETER, false); /* Calendar from = DateUtils.getStartCalendar(2018, Calendar.APRIL, 1);