### Question:
LanguageServiceImpl implements LanguageService { @Override public String extractLanguageCodeFromRequest() { String languageCode = request.getParameter("language"); if (languageCode == null) { return AppConstant.DEFAULT_LANGUAGE_CODE; } return languageCode; } @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 extractExistingLanguageCodeFromRequest() { String expectedLanguageCode = "uk"; when(request.getParameter("language")).thenReturn(expectedLanguageCode); assertEquals(expectedLanguageCode, languageService.extractLanguageCodeFromRequest()); }
@Test public void extractNotExistingLanguageCodeFromRequest() { when(request.getParameter("language")).thenReturn(null); assertEquals(AppConstant.DEFAULT_LANGUAGE_CODE, languageService.extractLanguageCodeFromRequest()); }