@Test public void getAllHabitFactsFailed() { List<AdviceDTO> expected = Collections.emptyList(); when(modelMapper.map(factTranslationRepo.findAll(), new TypeToken<List<LanguageTranslationDTO>>() { }.getType())).thenReturn(expected); assertEquals(expected, habitFactService.getAllHabitFacts()); }
@Override public List<LanguageTranslationDTO> getAllHabitFacts() { List<FactTranslation> factTranslation = factTranslationRepo.findAll(); return modelMapper.map(factTranslation, new TypeToken<List<LanguageTranslationDTO>>() { }.getType()); }
HabitFactServiceImpl implements HabitFactService { @Override public List<LanguageTranslationDTO> getAllHabitFacts() { List<FactTranslation> factTranslation = factTranslationRepo.findAll(); return modelMapper.map(factTranslation, new TypeToken<List<LanguageTranslationDTO>>() { }.getType()); } }
HabitFactServiceImpl implements HabitFactService { @Override public List<LanguageTranslationDTO> getAllHabitFacts() { List<FactTranslation> factTranslation = factTranslationRepo.findAll(); return modelMapper.map(factTranslation, new TypeToken<List<LanguageTranslationDTO>>() { }.getType()); } @Autowired  HabitFactServiceImpl(ModelMapper modelMapper, HabitFactRepo habitFactRepo,
                                HabitDictionaryRepo habitDictionaryRepo, FactTranslationRepo factTranslationRepo); }
HabitFactServiceImpl implements HabitFactService { @Override public List<LanguageTranslationDTO> getAllHabitFacts() { List<FactTranslation> factTranslation = factTranslationRepo.findAll(); return modelMapper.map(factTranslation, new TypeToken<List<LanguageTranslationDTO>>() { }.getType()); } @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 List<LanguageTranslationDTO> getAllHabitFacts() { List<FactTranslation> factTranslation = factTranslationRepo.findAll(); return modelMapper.map(factTranslation, new TypeToken<List<LanguageTranslationDTO>>() { }.getType()); } @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);  }