@Test public void loadChartWithoutConfiguration() throws ComponentLookupException { List<MeasurementsChartConfiguration> settings = this.mocker.getComponentUnderTest().loadConfigurationsForMeasurementType("inexistent"); Assert.assertNotNull(settings); Assert.assertTrue(settings.isEmpty()); }
@Override public List<MeasurementsChartConfiguration> loadConfigurationsForMeasurementType(String measurementType) { ResourceBundle configuration = ResourceBundle.getBundle("measurementsChartsConfigurations"); String key = "charts." + measurementType + ".configurations"; if (!configuration.containsKey(key)) { return Collections.emptyList(); } String[] charts = configuration.getString(key).split(","); List<MeasurementsChartConfiguration> result = new ArrayList<>(charts.length); for (String chart : charts) { SimpleMeasurementsChartConfiguration chartSettings = loadChart(key + '.' + chart + '.', configuration); if (validateChart(chartSettings)) { chartSettings.measurementType = measurementType; result.add(chartSettings); } } return result; }
DefaultMeasurementsChartConfigurationsFactory implements MeasurementsChartConfigurationsFactory { @Override public List<MeasurementsChartConfiguration> loadConfigurationsForMeasurementType(String measurementType) { ResourceBundle configuration = ResourceBundle.getBundle("measurementsChartsConfigurations"); String key = "charts." + measurementType + ".configurations"; if (!configuration.containsKey(key)) { return Collections.emptyList(); } String[] charts = configuration.getString(key).split(","); List<MeasurementsChartConfiguration> result = new ArrayList<>(charts.length); for (String chart : charts) { SimpleMeasurementsChartConfiguration chartSettings = loadChart(key + '.' + chart + '.', configuration); if (validateChart(chartSettings)) { chartSettings.measurementType = measurementType; result.add(chartSettings); } } return result; } }
DefaultMeasurementsChartConfigurationsFactory implements MeasurementsChartConfigurationsFactory { @Override public List<MeasurementsChartConfiguration> loadConfigurationsForMeasurementType(String measurementType) { ResourceBundle configuration = ResourceBundle.getBundle("measurementsChartsConfigurations"); String key = "charts." + measurementType + ".configurations"; if (!configuration.containsKey(key)) { return Collections.emptyList(); } String[] charts = configuration.getString(key).split(","); List<MeasurementsChartConfiguration> result = new ArrayList<>(charts.length); for (String chart : charts) { SimpleMeasurementsChartConfiguration chartSettings = loadChart(key + '.' + chart + '.', configuration); if (validateChart(chartSettings)) { chartSettings.measurementType = measurementType; result.add(chartSettings); } } return result; }  }
DefaultMeasurementsChartConfigurationsFactory implements MeasurementsChartConfigurationsFactory { @Override public List<MeasurementsChartConfiguration> loadConfigurationsForMeasurementType(String measurementType) { ResourceBundle configuration = ResourceBundle.getBundle("measurementsChartsConfigurations"); String key = "charts." + measurementType + ".configurations"; if (!configuration.containsKey(key)) { return Collections.emptyList(); } String[] charts = configuration.getString(key).split(","); List<MeasurementsChartConfiguration> result = new ArrayList<>(charts.length); for (String chart : charts) { SimpleMeasurementsChartConfiguration chartSettings = loadChart(key + '.' + chart + '.', configuration); if (validateChart(chartSettings)) { chartSettings.measurementType = measurementType; result.add(chartSettings); } } return result; }  @Override List<MeasurementsChartConfiguration> loadConfigurationsForMeasurementType(String measurementType); }
DefaultMeasurementsChartConfigurationsFactory implements MeasurementsChartConfigurationsFactory { @Override public List<MeasurementsChartConfiguration> loadConfigurationsForMeasurementType(String measurementType) { ResourceBundle configuration = ResourceBundle.getBundle("measurementsChartsConfigurations"); String key = "charts." + measurementType + ".configurations"; if (!configuration.containsKey(key)) { return Collections.emptyList(); } String[] charts = configuration.getString(key).split(","); List<MeasurementsChartConfiguration> result = new ArrayList<>(charts.length); for (String chart : charts) { SimpleMeasurementsChartConfiguration chartSettings = loadChart(key + '.' + chart + '.', configuration); if (validateChart(chartSettings)) { chartSettings.measurementType = measurementType; result.add(chartSettings); } } return result; }  @Override List<MeasurementsChartConfiguration> loadConfigurationsForMeasurementType(String measurementType);  }