@Test public void testDefaults() { when(request.getCookies()).thenReturn(new Cookie[]{}); LocaleContext context = resolver.resolveLocaleContext(request); assertThat(context).isNotNull(); assertThat(context).isInstanceOf(TimeZoneAwareLocaleContext.class); assertThat(((TimeZoneAwareLocaleContext) context).getLocale()).isEqualTo(LOCALE_DEFAULT); assertThat(((TimeZoneAwareLocaleContext) context).getTimeZone()).isEqualTo(TIMEZONE_DEFAULT); List<Event> events = recorder.play(); assertThat(events).isEmpty(); }
@Override public LocaleContext resolveLocaleContext(final HttpServletRequest request) { parseAngularCookieIfNecessary(request); return new TimeZoneAwareLocaleContext() { @Override public Locale getLocale() { return (Locale) request.getAttribute(LOCALE_REQUEST_ATTRIBUTE_NAME); } @Override public TimeZone getTimeZone() { return (TimeZone) request.getAttribute(TIME_ZONE_REQUEST_ATTRIBUTE_NAME); } }; }
AngularCookieLocaleResolver extends CookieLocaleResolver { @Override public LocaleContext resolveLocaleContext(final HttpServletRequest request) { parseAngularCookieIfNecessary(request); return new TimeZoneAwareLocaleContext() { @Override public Locale getLocale() { return (Locale) request.getAttribute(LOCALE_REQUEST_ATTRIBUTE_NAME); } @Override public TimeZone getTimeZone() { return (TimeZone) request.getAttribute(TIME_ZONE_REQUEST_ATTRIBUTE_NAME); } }; } }
AngularCookieLocaleResolver extends CookieLocaleResolver { @Override public LocaleContext resolveLocaleContext(final HttpServletRequest request) { parseAngularCookieIfNecessary(request); return new TimeZoneAwareLocaleContext() { @Override public Locale getLocale() { return (Locale) request.getAttribute(LOCALE_REQUEST_ATTRIBUTE_NAME); } @Override public TimeZone getTimeZone() { return (TimeZone) request.getAttribute(TIME_ZONE_REQUEST_ATTRIBUTE_NAME); } }; }  }
AngularCookieLocaleResolver extends CookieLocaleResolver { @Override public LocaleContext resolveLocaleContext(final HttpServletRequest request) { parseAngularCookieIfNecessary(request); return new TimeZoneAwareLocaleContext() { @Override public Locale getLocale() { return (Locale) request.getAttribute(LOCALE_REQUEST_ATTRIBUTE_NAME); } @Override public TimeZone getTimeZone() { return (TimeZone) request.getAttribute(TIME_ZONE_REQUEST_ATTRIBUTE_NAME); } }; }  @Override Locale resolveLocale(HttpServletRequest request); @Override LocaleContext resolveLocaleContext(final HttpServletRequest request); @Override void addCookie(HttpServletResponse response, String cookieValue); }
AngularCookieLocaleResolver extends CookieLocaleResolver { @Override public LocaleContext resolveLocaleContext(final HttpServletRequest request) { parseAngularCookieIfNecessary(request); return new TimeZoneAwareLocaleContext() { @Override public Locale getLocale() { return (Locale) request.getAttribute(LOCALE_REQUEST_ATTRIBUTE_NAME); } @Override public TimeZone getTimeZone() { return (TimeZone) request.getAttribute(TIME_ZONE_REQUEST_ATTRIBUTE_NAME); } }; }  @Override Locale resolveLocale(HttpServletRequest request); @Override LocaleContext resolveLocaleContext(final HttpServletRequest request); @Override void addCookie(HttpServletResponse response, String cookieValue); static final String QUOTE; }