StatisticsDao { public Statistics getQueueStatistics() { return new Statistics(queuedStatistics(), executionStatistics()); } @Inject  StatisticsDao(@NFlow JdbcTemplate jdbcTemplate, ExecutorDao executorDao); Statistics getQueueStatistics(); Map<String, Map<String, WorkflowDefinitionStatistics>> getWorkflowDefinitionStatistics(String type,
      DateTime createdAfter, DateTime createdBefore, DateTime modifiedAfter, DateTime modifiedBefore);  }
@Test public void getQueueStatisticsReasonableResults() { Statistics stats = statisticsDao.getQueueStatistics(); QueueStatistics exec = stats.executionStatistics; assertThat(exec.count, is(0)); assertThat(exec.maxAgeMillis, nullValue()); assertThat(exec.minAgeMillis, nullValue()); QueueStatistics queued = stats.queuedStatistics; assertThat(queued.count, is(2)); assertThat(queued.maxAgeMillis, greaterThanOrEqualTo(queued.minAgeMillis)); assertThat(queued.maxAgeMillis, greaterThanOrEqualTo(0L)); assertThat(queued.minAgeMillis, greaterThanOrEqualTo(0L)); }