@Test public void assertFindJobRegisterStatisticsWhenRdbIsConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); when(rdbRepository.findJobRegisterStatistics(any(Date.class))).thenReturn(Collections.singletonList(new JobRegisterStatistics(10, new Date()))); assertThat(statisticManager.findJobRegisterStatisticsSinceOnline().size(), is(1)); verify(rdbRepository).findJobRegisterStatistics(any(Date.class)); }
public List<JobRegisterStatistics> findJobRegisterStatisticsSinceOnline() { if (!isRdbConfigured()) { return Collections.emptyList(); } return rdbRepository.findJobRegisterStatistics(getOnlineDate()); }
StatisticManager { public List<JobRegisterStatistics> findJobRegisterStatisticsSinceOnline() { if (!isRdbConfigured()) { return Collections.emptyList(); } return rdbRepository.findJobRegisterStatistics(getOnlineDate()); } }
StatisticManager { public List<JobRegisterStatistics> findJobRegisterStatisticsSinceOnline() { if (!isRdbConfigured()) { return Collections.emptyList(); } return rdbRepository.findJobRegisterStatistics(getOnlineDate()); } private  StatisticManager(final CoordinatorRegistryCenter registryCenter, final TracingConfiguration tracingConfiguration,
                             final StatisticsScheduler scheduler, final Map<StatisticInterval, TaskResultMetaData> statisticData); }
StatisticManager { public List<JobRegisterStatistics> findJobRegisterStatisticsSinceOnline() { if (!isRdbConfigured()) { return Collections.emptyList(); } return rdbRepository.findJobRegisterStatistics(getOnlineDate()); } private  StatisticManager(final CoordinatorRegistryCenter registryCenter, final TracingConfiguration tracingConfiguration,
                             final StatisticsScheduler scheduler, final Map<StatisticInterval, TaskResultMetaData> statisticData); static StatisticManager getInstance(final CoordinatorRegistryCenter regCenter, final TracingConfiguration tracingConfiguration); void startup(); void shutdown(); void taskRunSuccessfully(); void taskRunFailed(); TaskResultStatistics getTaskResultStatisticsWeekly(); TaskResultStatistics getTaskResultStatisticsSinceOnline(); TaskResultStatistics findLatestTaskResultStatistics(final StatisticInterval statisticInterval); List<TaskResultStatistics> findTaskResultStatisticsDaily(); JobExecutionTypeStatistics getJobExecutionTypeStatistics(); List<TaskRunningStatistics> findTaskRunningStatisticsWeekly(); List<JobRunningStatistics> findJobRunningStatisticsWeekly(); List<JobRegisterStatistics> findJobRegisterStatisticsSinceOnline(); }
StatisticManager { public List<JobRegisterStatistics> findJobRegisterStatisticsSinceOnline() { if (!isRdbConfigured()) { return Collections.emptyList(); } return rdbRepository.findJobRegisterStatistics(getOnlineDate()); } private  StatisticManager(final CoordinatorRegistryCenter registryCenter, final TracingConfiguration tracingConfiguration,
                             final StatisticsScheduler scheduler, final Map<StatisticInterval, TaskResultMetaData> statisticData); static StatisticManager getInstance(final CoordinatorRegistryCenter regCenter, final TracingConfiguration tracingConfiguration); void startup(); void shutdown(); void taskRunSuccessfully(); void taskRunFailed(); TaskResultStatistics getTaskResultStatisticsWeekly(); TaskResultStatistics getTaskResultStatisticsSinceOnline(); TaskResultStatistics findLatestTaskResultStatistics(final StatisticInterval statisticInterval); List<TaskResultStatistics> findTaskResultStatisticsDaily(); JobExecutionTypeStatistics getJobExecutionTypeStatistics(); List<TaskRunningStatistics> findTaskRunningStatisticsWeekly(); List<JobRunningStatistics> findJobRunningStatisticsWeekly(); List<JobRegisterStatistics> findJobRegisterStatisticsSinceOnline();  }