@Test public void findAllWithEmptyListTest() { when(achievementRepo.findAll()).thenReturn(Collections.emptyList()); List<AchievementDTO> findAllResult = achievementService.findAll(); assertTrue(findAllResult.isEmpty()); }
@Cacheable(value = CacheConstants.ALL_ACHIEVEMENTS_CACHE_NAME) @Override public List<AchievementDTO> findAll() { return achievementRepo.findAll() .stream() .map(achieve -> modelMapper.map(achieve, AchievementDTO.class)) .collect(Collectors.toList()); }
AchievementServiceImpl implements AchievementService { @Cacheable(value = CacheConstants.ALL_ACHIEVEMENTS_CACHE_NAME) @Override public List<AchievementDTO> findAll() { return achievementRepo.findAll() .stream() .map(achieve -> modelMapper.map(achieve, AchievementDTO.class)) .collect(Collectors.toList()); } }
AchievementServiceImpl implements AchievementService { @Cacheable(value = CacheConstants.ALL_ACHIEVEMENTS_CACHE_NAME) @Override public List<AchievementDTO> findAll() { return achievementRepo.findAll() .stream() .map(achieve -> modelMapper.map(achieve, AchievementDTO.class)) .collect(Collectors.toList()); }  }
AchievementServiceImpl implements AchievementService { @Cacheable(value = CacheConstants.ALL_ACHIEVEMENTS_CACHE_NAME) @Override public List<AchievementDTO> findAll() { return achievementRepo.findAll() .stream() .map(achieve -> modelMapper.map(achieve, AchievementDTO.class)) .collect(Collectors.toList()); }  @Cacheable(value = CacheConstants.ALL_ACHIEVEMENTS_CACHE_NAME) @Override List<AchievementDTO> findAll(); }
AchievementServiceImpl implements AchievementService { @Cacheable(value = CacheConstants.ALL_ACHIEVEMENTS_CACHE_NAME) @Override public List<AchievementDTO> findAll() { return achievementRepo.findAll() .stream() .map(achieve -> modelMapper.map(achieve, AchievementDTO.class)) .collect(Collectors.toList()); }  @Cacheable(value = CacheConstants.ALL_ACHIEVEMENTS_CACHE_NAME) @Override List<AchievementDTO> findAll();  }