@Test public void getNumberOfPes() { }
public Map<String, Long> getNumberOfPes(LocalDateTime fromLocalDate, LocalDateTime toLocalDate, StatusType statusType) { Map<String, Long> listNumberPesByType = new HashMap<>(); if(statusType == null) { for (StatusType type : StatusType.values()) { listNumberPesByType.put( type.name(), pesHistoryRepository.countByDateBetweenAndStatus(fromLocalDate, toLocalDate, type)); } } else { listNumberPesByType.put( statusType.name(), pesHistoryRepository.countByDateBetweenAndStatus(fromLocalDate, toLocalDate, statusType)); } return listNumberPesByType; }
MetricService { public Map<String, Long> getNumberOfPes(LocalDateTime fromLocalDate, LocalDateTime toLocalDate, StatusType statusType) { Map<String, Long> listNumberPesByType = new HashMap<>(); if(statusType == null) { for (StatusType type : StatusType.values()) { listNumberPesByType.put( type.name(), pesHistoryRepository.countByDateBetweenAndStatus(fromLocalDate, toLocalDate, type)); } } else { listNumberPesByType.put( statusType.name(), pesHistoryRepository.countByDateBetweenAndStatus(fromLocalDate, toLocalDate, statusType)); } return listNumberPesByType; } }
MetricService { public Map<String, Long> getNumberOfPes(LocalDateTime fromLocalDate, LocalDateTime toLocalDate, StatusType statusType) { Map<String, Long> listNumberPesByType = new HashMap<>(); if(statusType == null) { for (StatusType type : StatusType.values()) { listNumberPesByType.put( type.name(), pesHistoryRepository.countByDateBetweenAndStatus(fromLocalDate, toLocalDate, type)); } } else { listNumberPesByType.put( statusType.name(), pesHistoryRepository.countByDateBetweenAndStatus(fromLocalDate, toLocalDate, statusType)); } return listNumberPesByType; } @Autowired  MetricService(PesHistoryRepository pesHistoryRepository); }
MetricService { public Map<String, Long> getNumberOfPes(LocalDateTime fromLocalDate, LocalDateTime toLocalDate, StatusType statusType) { Map<String, Long> listNumberPesByType = new HashMap<>(); if(statusType == null) { for (StatusType type : StatusType.values()) { listNumberPesByType.put( type.name(), pesHistoryRepository.countByDateBetweenAndStatus(fromLocalDate, toLocalDate, type)); } } else { listNumberPesByType.put( statusType.name(), pesHistoryRepository.countByDateBetweenAndStatus(fromLocalDate, toLocalDate, statusType)); } return listNumberPesByType; } @Autowired  MetricService(PesHistoryRepository pesHistoryRepository); Map<String, Long> getNumberOfPes(LocalDateTime fromLocalDate, LocalDateTime toLocalDate, StatusType statusType); Map<String, List<Map<LocalDateTime, Long>>> getNumberOfPesWithSample(LocalDateTime fromLocalDate, LocalDateTime toLocalDate, StatusType statusType, String sample); }
MetricService { public Map<String, Long> getNumberOfPes(LocalDateTime fromLocalDate, LocalDateTime toLocalDate, StatusType statusType) { Map<String, Long> listNumberPesByType = new HashMap<>(); if(statusType == null) { for (StatusType type : StatusType.values()) { listNumberPesByType.put( type.name(), pesHistoryRepository.countByDateBetweenAndStatus(fromLocalDate, toLocalDate, type)); } } else { listNumberPesByType.put( statusType.name(), pesHistoryRepository.countByDateBetweenAndStatus(fromLocalDate, toLocalDate, statusType)); } return listNumberPesByType; } @Autowired  MetricService(PesHistoryRepository pesHistoryRepository); Map<String, Long> getNumberOfPes(LocalDateTime fromLocalDate, LocalDateTime toLocalDate, StatusType statusType); Map<String, List<Map<LocalDateTime, Long>>> getNumberOfPesWithSample(LocalDateTime fromLocalDate, LocalDateTime toLocalDate, StatusType statusType, String sample);  }