@Test public void getAllAdvices() { List<LanguageTranslationDTO> expected = Collections.emptyList(); when(modelMapper.map(adviceTranslationRepo.findAll(), new TypeToken<List<LanguageTranslationDTO>>() { }.getType())).thenReturn(expected); assertEquals(expected, adviceService.getAllAdvices()); }
@Override public List<LanguageTranslationDTO> getAllAdvices() { return modelMapper.map(adviceTranslationRepo.findAll(), new TypeToken<List<LanguageTranslationDTO>>() { }.getType()); }
AdviceServiceImpl implements AdviceService { @Override public List<LanguageTranslationDTO> getAllAdvices() { return modelMapper.map(adviceTranslationRepo.findAll(), new TypeToken<List<LanguageTranslationDTO>>() { }.getType()); } }
AdviceServiceImpl implements AdviceService { @Override public List<LanguageTranslationDTO> getAllAdvices() { return modelMapper.map(adviceTranslationRepo.findAll(), new TypeToken<List<LanguageTranslationDTO>>() { }.getType()); } @Autowired  AdviceServiceImpl(AdviceRepo adviceRepo, HabitDictionaryRepo habitDictionaryRepo,
                             AdviceTranslationRepo adviceTranslationRepo, ModelMapper modelMapper); }
AdviceServiceImpl implements AdviceService { @Override public List<LanguageTranslationDTO> getAllAdvices() { return modelMapper.map(adviceTranslationRepo.findAll(), new TypeToken<List<LanguageTranslationDTO>>() { }.getType()); } @Autowired  AdviceServiceImpl(AdviceRepo adviceRepo, HabitDictionaryRepo habitDictionaryRepo,
                             AdviceTranslationRepo adviceTranslationRepo, ModelMapper modelMapper); @Override List<LanguageTranslationDTO> getAllAdvices(); @Override LanguageTranslationDTO getRandomAdviceByHabitIdAndLanguage(Long id, String language); @Override AdviceDTO getAdviceById(Long id); @Override AdviceDTO getAdviceByName(String language, String name); @Override Advice save(AdvicePostDTO advicePostDTO); @Override Advice update(AdvicePostDTO advice, Long id); @Override Long delete(Long id); }
AdviceServiceImpl implements AdviceService { @Override public List<LanguageTranslationDTO> getAllAdvices() { return modelMapper.map(adviceTranslationRepo.findAll(), new TypeToken<List<LanguageTranslationDTO>>() { }.getType()); } @Autowired  AdviceServiceImpl(AdviceRepo adviceRepo, HabitDictionaryRepo habitDictionaryRepo,
                             AdviceTranslationRepo adviceTranslationRepo, ModelMapper modelMapper); @Override List<LanguageTranslationDTO> getAllAdvices(); @Override LanguageTranslationDTO getRandomAdviceByHabitIdAndLanguage(Long id, String language); @Override AdviceDTO getAdviceById(Long id); @Override AdviceDTO getAdviceByName(String language, String name); @Override Advice save(AdvicePostDTO advicePostDTO); @Override Advice update(AdvicePostDTO advice, Long id); @Override Long delete(Long id);  }