### Question:
StatisticManager { public List<TaskRunningStatistics> findTaskRunningStatisticsWeekly() { if (!isRdbConfigured()) { return Collections.emptyList(); } return rdbRepository.findTaskRunningStatistics(StatisticTimeUtils.getStatisticTime(StatisticInterval.DAY, -7)); } private  StatisticManager(final CoordinatorRegistryCenter registryCenter, final Optional<JobEventRdbConfiguration> jobEventRdbConfiguration,
                             final StatisticsScheduler scheduler, final Map<StatisticInterval, TaskResultMetaData> statisticData); static StatisticManager getInstance(final CoordinatorRegistryCenter regCenter, final Optional<JobEventRdbConfiguration> jobEventRdbConfiguration); void startup(); void shutdown(); void taskRunSuccessfully(); void taskRunFailed(); TaskResultStatistics getTaskResultStatisticsWeekly(); TaskResultStatistics getTaskResultStatisticsSinceOnline(); TaskResultStatistics findLatestTaskResultStatistics(final StatisticInterval statisticInterval); List<TaskResultStatistics> findTaskResultStatisticsDaily(); JobTypeStatistics getJobTypeStatistics(); JobExecutionTypeStatistics getJobExecutionTypeStatistics(); List<TaskRunningStatistics> findTaskRunningStatisticsWeekly(); List<JobRunningStatistics> findJobRunningStatisticsWeekly(); List<JobRegisterStatistics> findJobRegisterStatisticsSinceOnline();  }### Answer:
@Test public void assertFindTaskRunningStatisticsWhenRdbIsNotConfigured() throws NoSuchFieldException { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); Assert.assertTrue(statisticManager.findTaskRunningStatisticsWeekly().isEmpty()); }
@Test public void assertFindTaskRunningStatisticsWhenRdbIsConfigured() throws NoSuchFieldException { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); Mockito.when(rdbRepository.findTaskRunningStatistics(Mockito.any(Date.class))) .thenReturn(Lists.newArrayList(new TaskRunningStatistics(10, new Date()))); Assert.assertThat(statisticManager.findTaskRunningStatisticsWeekly().size(), Is.is(1)); Mockito.verify(rdbRepository).findTaskRunningStatistics(Mockito.any(Date.class)); }