@Test(expected = NotFoundException.class) public void getHabitFactByIdFailed() { habitFactService.getHabitFactById(anyLong()); }
@Override public HabitFactDTO getHabitFactById(Long id) { return modelMapper.map(habitFactRepo.findById(id) .orElseThrow(() -> new NotFoundException(ErrorMessage.HABIT_FACT_NOT_FOUND_BY_ID + id)), HabitFactDTO.class); }
HabitFactServiceImpl implements HabitFactService { @Override public HabitFactDTO getHabitFactById(Long id) { return modelMapper.map(habitFactRepo.findById(id) .orElseThrow(() -> new NotFoundException(ErrorMessage.HABIT_FACT_NOT_FOUND_BY_ID + id)), HabitFactDTO.class); } }
HabitFactServiceImpl implements HabitFactService { @Override public HabitFactDTO getHabitFactById(Long id) { return modelMapper.map(habitFactRepo.findById(id) .orElseThrow(() -> new NotFoundException(ErrorMessage.HABIT_FACT_NOT_FOUND_BY_ID + id)), HabitFactDTO.class); } @Autowired  HabitFactServiceImpl(ModelMapper modelMapper, HabitFactRepo habitFactRepo,
                                HabitDictionaryRepo habitDictionaryRepo, FactTranslationRepo factTranslationRepo); }
HabitFactServiceImpl implements HabitFactService { @Override public HabitFactDTO getHabitFactById(Long id) { return modelMapper.map(habitFactRepo.findById(id) .orElseThrow(() -> new NotFoundException(ErrorMessage.HABIT_FACT_NOT_FOUND_BY_ID + id)), HabitFactDTO.class); } @Autowired  HabitFactServiceImpl(ModelMapper modelMapper, HabitFactRepo habitFactRepo,
                                HabitDictionaryRepo habitDictionaryRepo, FactTranslationRepo factTranslationRepo); @Override List<LanguageTranslationDTO> getAllHabitFacts(); @Override LanguageTranslationDTO getRandomHabitFactByHabitIdAndLanguage(Long id, String language); @Override HabitFactDTO getHabitFactById(Long id); @Override HabitFactDTO getHabitFactByName(String language, String name); @Override HabitFact save(HabitFactPostDTO fact); @Override HabitFact update(HabitFactPostDTO fact, Long id); @Override Long delete(Long id); }
HabitFactServiceImpl implements HabitFactService { @Override public HabitFactDTO getHabitFactById(Long id) { return modelMapper.map(habitFactRepo.findById(id) .orElseThrow(() -> new NotFoundException(ErrorMessage.HABIT_FACT_NOT_FOUND_BY_ID + id)), HabitFactDTO.class); } @Autowired  HabitFactServiceImpl(ModelMapper modelMapper, HabitFactRepo habitFactRepo,
                                HabitDictionaryRepo habitDictionaryRepo, FactTranslationRepo factTranslationRepo); @Override List<LanguageTranslationDTO> getAllHabitFacts(); @Override LanguageTranslationDTO getRandomHabitFactByHabitIdAndLanguage(Long id, String language); @Override HabitFactDTO getHabitFactById(Long id); @Override HabitFactDTO getHabitFactByName(String language, String name); @Override HabitFact save(HabitFactPostDTO fact); @Override HabitFact update(HabitFactPostDTO fact, Long id); @Override Long delete(Long id);  }