@Test void testResolveLocaleNotAuthenticated() { HttpServletRequest httpServletRequest = mock(HttpServletRequest.class); when(fallbackLocaleSupplier.get()).thenReturn(Locale.GERMAN); assertEquals(GERMAN, httpLocaleResolver.resolveLocale(httpServletRequest)); }
@Override public Locale resolveLocale(HttpServletRequest request) { String username = SecurityUtils.getCurrentUsername(); Locale locale; if (username != null) { locale = userLocaleResolver.resolveLocale(username); } else { locale = fallbackLocaleSupplier.get(); } return locale; }
HttpLocaleResolver implements LocaleResolver { @Override public Locale resolveLocale(HttpServletRequest request) { String username = SecurityUtils.getCurrentUsername(); Locale locale; if (username != null) { locale = userLocaleResolver.resolveLocale(username); } else { locale = fallbackLocaleSupplier.get(); } return locale; } }
HttpLocaleResolver implements LocaleResolver { @Override public Locale resolveLocale(HttpServletRequest request) { String username = SecurityUtils.getCurrentUsername(); Locale locale; if (username != null) { locale = userLocaleResolver.resolveLocale(username); } else { locale = fallbackLocaleSupplier.get(); } return locale; } HttpLocaleResolver(
      UserLocaleResolver userLocaleResolver,
      FallbackLocaleSupplier fallbackLocaleSupplier,
      UserService userService); }
HttpLocaleResolver implements LocaleResolver { @Override public Locale resolveLocale(HttpServletRequest request) { String username = SecurityUtils.getCurrentUsername(); Locale locale; if (username != null) { locale = userLocaleResolver.resolveLocale(username); } else { locale = fallbackLocaleSupplier.get(); } return locale; } HttpLocaleResolver(
      UserLocaleResolver userLocaleResolver,
      FallbackLocaleSupplier fallbackLocaleSupplier,
      UserService userService); @Override Locale resolveLocale(HttpServletRequest request); @Override void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale); }
HttpLocaleResolver implements LocaleResolver { @Override public Locale resolveLocale(HttpServletRequest request) { String username = SecurityUtils.getCurrentUsername(); Locale locale; if (username != null) { locale = userLocaleResolver.resolveLocale(username); } else { locale = fallbackLocaleSupplier.get(); } return locale; } HttpLocaleResolver(
      UserLocaleResolver userLocaleResolver,
      FallbackLocaleSupplier fallbackLocaleSupplier,
      UserService userService); @Override Locale resolveLocale(HttpServletRequest request); @Override void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale);  }