diff --git a/src/test/java/org/gcube/accounting/aggregator/plugin/AggregatorAccountingPluginSmartExecutorSchedulerTest.java b/src/test/java/org/gcube/accounting/aggregator/plugin/AggregatorAccountingPluginSmartExecutorSchedulerTest.java index 85c3773..91c938e 100644 --- a/src/test/java/org/gcube/accounting/aggregator/plugin/AggregatorAccountingPluginSmartExecutorSchedulerTest.java +++ b/src/test/java/org/gcube/accounting/aggregator/plugin/AggregatorAccountingPluginSmartExecutorSchedulerTest.java @@ -61,7 +61,7 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped ServiceUsageRecord.class.newInstance().getRecordType()); // Start Aggregation Date - Calendar aggregationStartCalendar = Utility.getAggregationStartCalendar(2017, Calendar.JUNE, + Calendar aggregationStartCalendar = Utility.getAggregationStartCalendar(2017, Calendar.APRIL, 1); String aggregationStartDate = AccountingAggregatorPlugin.AGGREGATION_START_DATE_DATE_FORMAT .format(aggregationStartCalendar.getTime()); @@ -69,7 +69,7 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped aggregationStartDate); inputs.put(AccountingAggregatorPlugin.AGGREGATION_START_DATE_INPUT_PARAMETER, aggregationStartDate); - inputs.put(AccountingAggregatorPlugin.RESTART_FROM_LAST_AGGREGATION_DATE_INPUT_PARAMETER, true); + inputs.put(AccountingAggregatorPlugin.RESTART_FROM_LAST_AGGREGATION_DATE_INPUT_PARAMETER, false); return inputs; } @@ -92,12 +92,12 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped public void aggregate() throws Exception { // Every 15 minutes CronExpression cronExpression = new CronExpression("0 0/15 * 1/1 * ? *"); - Scheduling scheduling = new Scheduling(cronExpression, false); + Scheduling scheduling = new Scheduling(cronExpression, true); scheduling.setGlobal(false); Map inputs = getAggregateInputs(); - launch(scheduling, inputs); + launch(null, inputs); } diff --git a/src/test/java/org/gcube/accounting/analytics/persistence/couchbase/RemoveOldRecords.java b/src/test/java/org/gcube/accounting/analytics/persistence/couchbase/RemoveOldRecords.java index 078568f..62eea86 100644 --- a/src/test/java/org/gcube/accounting/analytics/persistence/couchbase/RemoveOldRecords.java +++ b/src/test/java/org/gcube/accounting/analytics/persistence/couchbase/RemoveOldRecords.java @@ -1,10 +1,11 @@ package org.gcube.accounting.analytics.persistence.couchbase; -import java.text.SimpleDateFormat; +import java.text.DateFormat; import java.util.Calendar; import java.util.concurrent.TimeUnit; import org.gcube.accounting.aggregator.aggregation.AggregationType; +import org.gcube.accounting.aggregator.utility.Utility; import org.gcube.accounting.analytics.persistence.AccountingPersistenceBackendQueryConfiguration; import org.gcube.testutility.ScopedTest; import org.junit.Test; @@ -43,7 +44,7 @@ public class RemoveOldRecords extends ScopedTest { AccountingPersistenceQueryCouchBase accountingPersistenceQueryCouchBase = new AccountingPersistenceQueryCouchBase(); accountingPersistenceQueryCouchBase.prepareConnection(configuration); - SimpleDateFormat format = new SimpleDateFormat(AggregationType.DAILY.getDateFormatPattern()); + DateFormat format = Utility.getUTCDateFormat(AggregationType.DAILY.getDateFormatPattern()); Calendar start = Calendar.getInstance(); start.set(Calendar.YEAR, 1970); diff --git a/src/test/java/org/gcube/accounting/datamodel/usagerecords/TestUsageRecord.java b/src/test/java/org/gcube/accounting/datamodel/usagerecords/TestUsageRecord.java index a623546..7ed6afa 100644 --- a/src/test/java/org/gcube/accounting/datamodel/usagerecords/TestUsageRecord.java +++ b/src/test/java/org/gcube/accounting/datamodel/usagerecords/TestUsageRecord.java @@ -203,7 +203,7 @@ public class TestUsageRecord { inputParameters.put(TEST_NESTED_MAP, parameter); - usageRecord.setInputParameters(inputParameters); + //usageRecord.setInputParameters(inputParameters); } catch (InvalidValueException e) { logger.error(" ------ You SHOULD NOT SEE THIS MESSAGE. Error Creating a test Usage Record", e);