### Question:
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();  }### Answer:
@Test public void findByCode() { when(languageRepo.findByCode(language.getCode())).thenReturn(Optional.of(language)); assertEquals(language, languageService.findByCode(language.getCode())); }
@Test(expected = LanguageNotFoundException.class) public void findCodeByIdFailed() { languageService.findByCode(language.getCode()); }