@Test public void loadChartWithInvalidConfiguration() throws ComponentLookupException { this.mocker.getComponentUnderTest().loadConfigurationsForMeasurementType("tested"); Mockito.verify(this.mocker.getMockedLogger()).warn( "Invalid chart settings for [{}]: age limits missing or out of order: [{}] and [{}]", "charts.tested.configurations.invalid.", 36, 12); Mockito.verify(this.mocker.getMockedLogger()).warn( "Invalid chart settings for [{}]: age grid lines don't fit evenly: [{}] in [{}-{}]", "charts.tested.configurations.invalid.", 7, 36, 12); Mockito.verify(this.mocker.getMockedLogger()).warn( "Invalid chart settings for [{}]: major/minor age grid lines don't match: [{}]/[{}]", "charts.tested.configurations.invalid.", 5, 7); Mockito.verify(this.mocker.getMockedLogger()).warn( "Invalid chart settings for [{}]: value limits missing or out of order: [{}] and [{}]", "charts.tested.configurations.invalid.", 19.5, 1.0); Mockito.verify(this.mocker.getMockedLogger()).warn( "Invalid chart settings for [{}]: value should be positive, was [{}]", "charts.tested.configurations.invalid.valueTickStep", "-1"); Mockito.verify(this.mocker.getMockedLogger()).warn( "Invalid chart settings for [{}]: value grid lines don't fit evenly: [{}] in [{}-{}]", "charts.tested.configurations.invalid.", 0.2, 19.5, 1.0); Mockito.verify(this.mocker.getMockedLogger()).warn( "Invalid chart settings for [{}]: major/minor value grid lines don't match: [{}]/[{}]", "charts.tested.configurations.invalid.", 1.1, 0.2); Mockito.verify(this.mocker.getMockedLogger()).warn("Invalid chart settings for [{}]: missing chart title", "charts.tested.configurations.invalid."); Mockito.verify(this.mocker.getMockedLogger()).warn( "Invalid chart settings for [{}]: missing left and right labels", "charts.tested.configurations.invalid."); Mockito.verify(this.mocker.getMockedLogger()).warn( "Invalid chart settings for [{}]: missing top and bottom labels", "charts.tested.configurations.invalid."); }
@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);  }