@Test public void testGetDoubles() { Mockito.doReturn(" [1234, 123, value3]").when(pippoSettings) .getString("key", null); Mockito.doCallRealMethod().when(pippoSettings).getStrings("key", ","); Mockito.doCallRealMethod().when(pippoSettings).getDoubles("key", ","); List<Double> values = pippoSettings.getDoubles("key", ","); assertEquals(Arrays.asList(1234d, 123d), values); Mockito.doReturn(Collections.emptyList()).when(pippoSettings).getStrings("key", ","); values = pippoSettings.getDoubles("key", ","); assertTrue(values.isEmpty()); }
public List<Double> getDoubles(String name) { return getDoubles(name, DEFAULT_LIST_DELIMITER); }
PippoSettings { public List<Double> getDoubles(String name) { return getDoubles(name, DEFAULT_LIST_DELIMITER); } }
PippoSettings { public List<Double> getDoubles(String name) { return getDoubles(name, DEFAULT_LIST_DELIMITER); } PippoSettings(RuntimeMode runtimeMode); }
PippoSettings { public List<Double> getDoubles(String name) { return getDoubles(name, DEFAULT_LIST_DELIMITER); } PippoSettings(RuntimeMode runtimeMode); RuntimeMode getRuntimeMode(); boolean isDev(); boolean isTest(); boolean isProd(); String getLocalHostname(); List<String> getSettingNames(); List<String> getSettingNames(String startingWith); String getString(String name, String defaultValue); String getInterpolatedString(String name, String defaultValue); boolean getBoolean(String name, boolean defaultValue); int getInteger(String name, int defaultValue); long getLong(String name, long defaultValue); float getFloat(String name, float defaultValue); double getDouble(String name, double defaultValue); char getChar(String name, char defaultValue); String getRequiredString(String name); List<String> getStrings(String name); List<String> getStrings(String name, String delimiter); List<Integer> getIntegers(String name); List<Integer> getIntegers(String name, String delimiter); List<Long> getLongs(String name); List<Long> getLongs(String name, String delimiter); List<Float> getFloats(String name); List<Float> getFloats(String name, String delimiter); List<Double> getDoubles(String name); List<Double> getDoubles(String name, String delimiter); long getDurationInMilliseconds(String name); long getDurationInMilliseconds(String name, long defaultValue); long getDurationInSeconds(String name); long getDurationInSeconds(String name, long defaultValue); long getDurationInMinutes(String name); long getDurationInMinutes(String name, long defaultValue); long getDurationInHours(String name); long getDurationInHours(String name, long defaultValue); long getDurationInDays(String name); long getDurationInDays(String name, long defaultValue); boolean hasSetting(String name); void overrideSetting(String name, boolean value); void overrideSetting(String name, String value); void overrideSetting(String name, char value); void overrideSetting(String name, int value); void overrideSetting(String name, long value); void overrideSetting(String name, float value); void overrideSetting(String name, double value); }
PippoSettings { public List<Double> getDoubles(String name) { return getDoubles(name, DEFAULT_LIST_DELIMITER); } PippoSettings(RuntimeMode runtimeMode); RuntimeMode getRuntimeMode(); boolean isDev(); boolean isTest(); boolean isProd(); String getLocalHostname(); List<String> getSettingNames(); List<String> getSettingNames(String startingWith); String getString(String name, String defaultValue); String getInterpolatedString(String name, String defaultValue); boolean getBoolean(String name, boolean defaultValue); int getInteger(String name, int defaultValue); long getLong(String name, long defaultValue); float getFloat(String name, float defaultValue); double getDouble(String name, double defaultValue); char getChar(String name, char defaultValue); String getRequiredString(String name); List<String> getStrings(String name); List<String> getStrings(String name, String delimiter); List<Integer> getIntegers(String name); List<Integer> getIntegers(String name, String delimiter); List<Long> getLongs(String name); List<Long> getLongs(String name, String delimiter); List<Float> getFloats(String name); List<Float> getFloats(String name, String delimiter); List<Double> getDoubles(String name); List<Double> getDoubles(String name, String delimiter); long getDurationInMilliseconds(String name); long getDurationInMilliseconds(String name, long defaultValue); long getDurationInSeconds(String name); long getDurationInSeconds(String name, long defaultValue); long getDurationInMinutes(String name); long getDurationInMinutes(String name, long defaultValue); long getDurationInHours(String name); long getDurationInHours(String name, long defaultValue); long getDurationInDays(String name); long getDurationInDays(String name, long defaultValue); boolean hasSetting(String name); void overrideSetting(String name, boolean value); void overrideSetting(String name, String value); void overrideSetting(String name, char value); void overrideSetting(String name, int value); void overrideSetting(String name, long value); void overrideSetting(String name, float value); void overrideSetting(String name, double value);  }