@Test
    void verifyServiceHasLocaleAssigned() {
        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();
        val resolver = new SessionLocaleResolver();
        request.setAttribute(DispatcherServlet.LOCALE_RESOLVER_ATTRIBUTE, resolver);
        val service = RegisteredServiceTestUtils.getService();
        when(argumentExtractor.extractService(any(HttpServletRequest.class))).thenReturn(service);
        val registeredService = RegisteredServiceTestUtils.getRegisteredService();
        registeredService.setLocale("${T(java.util.Locale).GERMAN.getLanguage()}");
        when(servicesManager.findServiceBy(any(Service.class))).thenReturn(registeredService);
        getInterceptor(false).preHandle(request, response, new Object());
        assertEquals(Locale.GERMAN, resolver.resolveLocale(request));
    }
This is {@link CasLocaleChangeInterceptorTests}.

@author Misagh Moayyed
@since 6.4.0
core/cas-server-core-web/src/test/java/org/apereo/cas/web/support/CasLocaleChangeInterceptorTests.java