@Test public void testWithNotSupportedLocation() throws Exception { thrown.expect(UnsupportedLocationException.class); String expectedMessage = "Unsupported location: '" + LOCATION + "'"; thrown.expectMessage(expectedMessage); LocalizationProvider localizationProvider = createDefault(); when(localeResolver.getLocale()).thenReturn(Locale.ITALY); when(resourceLoader.isSupported(LOCATION)).thenReturn(false); try { localizationProvider.getString("str.key"); } finally { InOrder inOrder = inOrder(); inOrder.verify(localeResolver).getLocale(); inOrder.verify(resourceLoader).isSupported(LOCATION); inOrder.verifyNoMoreInteractions(); } }
@Override public String getString(String key) { return getPropertyResolver().getString(checkNotNull(key)); }
DefaultLocalizationProvider implements LocalizationProvider { @Override public String getString(String key) { return getPropertyResolver().getString(checkNotNull(key)); } }
DefaultLocalizationProvider implements LocalizationProvider { @Override public String getString(String key) { return getPropertyResolver().getString(checkNotNull(key)); } private  DefaultLocalizationProvider(Builder builder); }
DefaultLocalizationProvider implements LocalizationProvider { @Override public String getString(String key) { return getPropertyResolver().getString(checkNotNull(key)); } private  DefaultLocalizationProvider(Builder builder); @Override String getString(String key); @Override Boolean getBoolean(String key); @Override Integer getInteger(String key); @Override Long getLong(String key); @Override Float getFloat(String key); @Override Double getDouble(String key); @Override List<String> getStringList(String key); @Override Map<String, String> getStringMap(String key); @Override String getMessage(String key, Object... parameters); @Override MessageFormat getMessageFormat(String key); @Override String getSelectedMessage(String key, String selector, Object... parameters); @Override MessageFormat getSelectedMessageFormat(String key, String selector); @Override String getPluralMessage(String key, Number count, Object... parameters); MessageFormat getPluralMessageFormat(String key, Number count); static Builder builder(); }
DefaultLocalizationProvider implements LocalizationProvider { @Override public String getString(String key) { return getPropertyResolver().getString(checkNotNull(key)); } private  DefaultLocalizationProvider(Builder builder); @Override String getString(String key); @Override Boolean getBoolean(String key); @Override Integer getInteger(String key); @Override Long getLong(String key); @Override Float getFloat(String key); @Override Double getDouble(String key); @Override List<String> getStringList(String key); @Override Map<String, String> getStringMap(String key); @Override String getMessage(String key, Object... parameters); @Override MessageFormat getMessageFormat(String key); @Override String getSelectedMessage(String key, String selector, Object... parameters); @Override MessageFormat getSelectedMessageFormat(String key, String selector); @Override String getPluralMessage(String key, Number count, Object... parameters); MessageFormat getPluralMessageFormat(String key, Number count); static Builder builder(); static final char LOCALE_SEPARATOR; static final char FILE_EXTENSION_SEPARATOR; }