@Test public void testGetDouble() throws Exception { String key = "double.key"; Double value = Double.MAX_VALUE; LocalizationProvider localizationProvider = createDefault(); when(localeResolver.getLocale()).thenReturn(Locale.ITALY); when(resourceLoader.isSupported(LOCATION)).thenReturn(true); when(resourceLoader.openStream(LOCATION_ITALY)).thenReturn(null); when(resourceLoader.openStream(LOCATION_ITALIAN)).thenReturn(inputStream); when(localizationLoader.load(inputStream)).thenReturn(propertyResolver); when(propertyResolver.getDouble(key)).thenReturn(value); Double result = localizationProvider.getDouble(key); assertThat(result).isNotNull().isEqualTo(value); InOrder inOrder = inOrder(); inOrder.verify(localeResolver).getLocale(); inOrder.verify(resourceLoader).isSupported(LOCATION); inOrder.verify(resourceLoader).openStream(LOCATION_ITALY); inOrder.verify(resourceLoader).openStream(LOCATION_ITALIAN); inOrder.verify(localizationLoader).load(inputStream); inOrder.verify(propertyResolver).getDouble(key); inOrder.verifyNoMoreInteractions(); }
@Override public Double getDouble(String key) { return getPropertyResolver().getDouble(checkNotNull(key)); }
DefaultLocalizationProvider implements LocalizationProvider { @Override public Double getDouble(String key) { return getPropertyResolver().getDouble(checkNotNull(key)); } }
DefaultLocalizationProvider implements LocalizationProvider { @Override public Double getDouble(String key) { return getPropertyResolver().getDouble(checkNotNull(key)); } private  DefaultLocalizationProvider(Builder builder); }
DefaultLocalizationProvider implements LocalizationProvider { @Override public Double getDouble(String key) { return getPropertyResolver().getDouble(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 Double getDouble(String key) { return getPropertyResolver().getDouble(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; }