@Test public void findByCode() { when(languageRepo.findByCode(language.getCode())).thenReturn(Optional.of(language)); assertEquals(language, languageService.findByCode(language.getCode())); }
@Override public Language findByCode(String code) { return languageRepo.findByCode(code) .orElseThrow(() -> new LanguageNotFoundException(ErrorMessage.INVALID_LANGUAGE_CODE)); }
LanguageServiceImpl implements LanguageService { @Override public Language findByCode(String code) { return languageRepo.findByCode(code) .orElseThrow(() -> new LanguageNotFoundException(ErrorMessage.INVALID_LANGUAGE_CODE)); } }
LanguageServiceImpl implements LanguageService { @Override public Language findByCode(String code) { return languageRepo.findByCode(code) .orElseThrow(() -> new LanguageNotFoundException(ErrorMessage.INVALID_LANGUAGE_CODE)); } @Autowired  LanguageServiceImpl(
        LanguageRepo languageRepo,
        @Lazy ModelMapper modelMapper, HttpServletRequest request); }
LanguageServiceImpl implements LanguageService { @Override public Language findByCode(String code) { return languageRepo.findByCode(code) .orElseThrow(() -> new LanguageNotFoundException(ErrorMessage.INVALID_LANGUAGE_CODE)); } @Autowired  LanguageServiceImpl(
        LanguageRepo languageRepo,
        @Lazy ModelMapper modelMapper, HttpServletRequest request); @Override List<LanguageDTO> getAllLanguages(); @Override String extractLanguageCodeFromRequest(); @Override Language findByCode(String code); @Override List<String> findAllLanguageCodes(); }
LanguageServiceImpl implements LanguageService { @Override public Language findByCode(String code) { return languageRepo.findByCode(code) .orElseThrow(() -> new LanguageNotFoundException(ErrorMessage.INVALID_LANGUAGE_CODE)); } @Autowired  LanguageServiceImpl(
        LanguageRepo languageRepo,
        @Lazy ModelMapper modelMapper, HttpServletRequest request); @Override List<LanguageDTO> getAllLanguages(); @Override String extractLanguageCodeFromRequest(); @Override Language findByCode(String code); @Override List<String> findAllLanguageCodes();  }