コード例 #1
0
 @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());
 }
コード例 #2
0
 @Test
 public void testGetDefault() {
   when(mockReq.getLocale()).thenReturn(null);
   Provider<I18n> p = new I18nProvider(mockReq);
   I18n providedI18n = p.get();
   assertEquals(Locale.US, providedI18n.getLocale());
 }
コード例 #3
0
 @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());
 }