@Test public void testGetJapanese() { when(mockReq.getLocale()).thenReturn(Locale.JAPAN); Provider<I18n> p = new I18nProvider(mockReq); I18n providedI18n = p.get(); assertEquals(Locale.JAPAN, providedI18n.getLocale()); }
@Test public void testGetDefault() { when(mockReq.getLocale()).thenReturn(null); Provider<I18n> p = new I18nProvider(mockReq); I18n providedI18n = p.get(); assertEquals(Locale.US, providedI18n.getLocale()); }
@Test public void testGetFrench() { when(mockReq.getLocale()).thenReturn(Locale.FRANCE); Provider<I18n> p = new I18nProvider(mockReq); I18n providedI18n = p.get(); assertEquals(Locale.FRANCE, providedI18n.getLocale()); }