StatisticManager { public JobExecutionTypeStatistics getJobExecutionTypeStatistics() { int transientJobCnt = 0; int daemonJobCnt = 0; for (CloudJobConfigurationPOJO each : configurationService.loadAll()) { if (CloudJobExecutionType.TRANSIENT.equals(each.getJobExecutionType())) { transientJobCnt++; } else if (CloudJobExecutionType.DAEMON.equals(each.getJobExecutionType())) { daemonJobCnt++; } } return new JobExecutionTypeStatistics(transientJobCnt, daemonJobCnt); } 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();  }
@Test public void assertJobExecutionTypeStatistics() { ReflectionUtils.setFieldValue(statisticManager, "configurationService", configurationService); when(configurationService.loadAll()).thenReturn(Arrays.asList( CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job_1", CloudJobExecutionType.DAEMON), CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job_2", CloudJobExecutionType.TRANSIENT))); assertThat(statisticManager.getJobExecutionTypeStatistics().getDaemonJobCount(), is(1)); assertThat(statisticManager.getJobExecutionTypeStatistics().getTransientJobCount(), is(1)); verify(configurationService, times(2)).loadAll(); }