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 73df491..85c3773 100644 --- a/src/test/java/org/gcube/accounting/aggregator/plugin/AggregatorAccountingPluginSmartExecutorSchedulerTest.java +++ b/src/test/java/org/gcube/accounting/aggregator/plugin/AggregatorAccountingPluginSmartExecutorSchedulerTest.java @@ -38,21 +38,12 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped } - private String getPersistTimeParameter(int hour, int minute) { - Calendar persistEndTime = Calendar.getInstance(); - persistEndTime.set(Calendar.HOUR_OF_DAY, hour); - persistEndTime.set(Calendar.MINUTE, minute); - String persistEndTimeParameter = AccountingAggregatorPlugin.PERSIST_TIME_DATE_FORMAT - .format(persistEndTime.getTime()); - return persistEndTimeParameter; - } - private Map getRecoveryInputs() throws Exception { Map inputs = new HashMap(); inputs.put(AccountingAggregatorPlugin.ELABORATION_TYPE_INPUT_PARAMETER, ElaborationType.RECOVERY.name()); - inputs.put(AccountingAggregatorPlugin.PERSIST_START_TIME_INPUT_PARAMETER, getPersistTimeParameter(8, 0)); - inputs.put(AccountingAggregatorPlugin.PERSIST_END_TIME_INPUT_PARAMETER, getPersistTimeParameter(18, 0)); + inputs.put(AccountingAggregatorPlugin.PERSIST_START_TIME_INPUT_PARAMETER, Utility.getPersistTimeParameter(8, 0)); + inputs.put(AccountingAggregatorPlugin.PERSIST_END_TIME_INPUT_PARAMETER, Utility.getPersistTimeParameter(18, 0)); return inputs; } @@ -63,8 +54,8 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped inputs.put(AccountingAggregatorPlugin.ELABORATION_TYPE_INPUT_PARAMETER, ElaborationType.AGGREGATE.name()); - inputs.put(AccountingAggregatorPlugin.PERSIST_START_TIME_INPUT_PARAMETER, getPersistTimeParameter(8, 0)); - inputs.put(AccountingAggregatorPlugin.PERSIST_END_TIME_INPUT_PARAMETER, getPersistTimeParameter(18, 0)); + inputs.put(AccountingAggregatorPlugin.PERSIST_START_TIME_INPUT_PARAMETER, Utility.getPersistTimeParameter(8, 0)); + inputs.put(AccountingAggregatorPlugin.PERSIST_END_TIME_INPUT_PARAMETER, Utility.getPersistTimeParameter(18, 0)); inputs.put(AccountingAggregatorPlugin.RECORD_TYPE_INPUT_PARAMETER, ServiceUsageRecord.class.newInstance().getRecordType()); @@ -98,7 +89,7 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped } @Test - public void cronExpPreviousMustBeTerminated() throws Exception { + public void aggregate() throws Exception { // Every 15 minutes CronExpression cronExpression = new CronExpression("0 0/15 * 1/1 * ? *"); Scheduling scheduling = new Scheduling(cronExpression, false);