EventLogServiceImpl implements EventLogService { public List<?> getStatsByType(Integer logId, StatType statType) { List<?> stats; switch (statType) { case FILTER: stats = statisticRepository.findByLogid(logId); break; case CASE: case ACTIVITY: case RESOURCE: stats = statisticRepository.findByLogid(logId); break; default: stats = null; break; } return stats; } @Inject  EventLogServiceImpl(final LogRepository logRepository, final GroupRepository groupRepository,
                               final GroupLogRepository groupLogRepository, final FolderRepository folderRepo,
                               final UserService userSrv, final UserInterfaceHelper ui,
                               final StatisticRepository statisticRepository, final ConfigBean configBean, final DashboardLayoutRepository dashboardLayoutRepository); static XLog importFromStream(XFactory factory, InputStream is, String extension); @Override SummariesType readLogSummaries(Integer folderId, String searchExpression); @Override Log importLog(String username, Integer folderId, String logName, InputStream inputStreamLog,
                         String extension, String domain, String created, boolean publicModel); @Override void updateLogMetaData(Integer logId, String logName, boolean isPublic); @Override boolean isPublicLog(Integer logId); @Override ExportLogResultType exportLog(Integer logId); @Override void cloneLog(String username, Integer folderId, String logName, Integer sourceLogId,
                  String domain, String created, boolean publicModel); @Override XLog getXLog(Integer logId); @Override XLog getXLog(Integer logId, String factoryName); @Override XLog getXLogWithStats(Integer logId); List<Statistic> getStats(Integer logId); List<?> getStatsByType(Integer logId, StatType statType); @Override boolean isStatsExists(Integer logId, StatType statType); @Override void storeStats(Map<String, Map<String, Integer>> map, Integer logId); void storeStatsByType(Map<String, Map<String, String>> map, Integer logId, StatType statType); List<Statistic> flattenNestedStringMap(Map<String, Map<String, String>> map, Integer logId,
                                                  StatType statType); List<Statistic> flattenNestedMap(Map<String, Map<String, Integer>> map, Integer logId); @Override void deleteLogs(List<Log> logs, User user); @Override void exportToStream(OutputStream outputStream, XLog log); @Override APMLog getAggregatedLog(Integer logId); String getLayoutByLogId(Integer userId, Integer logId); void saveLayoutByLogId(Integer logId, Integer userId, String layout); static final String PARENT_NODE_FLAG; static final String STAT_NODE_NAME; }
@Test public void getStatsByType() { List<Statistic> stats = new ArrayList<>(); Integer logId = 001; expect(statisticRepository.findByLogid(logId)).andReturn(stats); replay(statisticRepository); List<Statistic> result = (List<Statistic>) eventLogService.getStatsByType(logId, StatType.FILTER); verify(statisticRepository); assertThat(result, equalTo(stats)); }