@Test(expected = NullPointerException.class) public void generateChart_NullChartCode() { chartGenerator.generateChart(null, mock(AnalysisForm.class)); }
public Chart<Object, Number> generateChart(ChartCode chartCode, AnalysisForm analysisForm) { Preconditions.checkNotNull(analysisForm); Preconditions.checkArgument(canGenerateChart(chartCode, analysisForm)); XSettingsGenerator xsettingsGenerator = xsettingsGeneratorManager.getXSettingsGenerator(chartCode); XSettings xsettings = xsettingsGenerator.generateXSettings(analysisForm.getGlobalFilter()); YSettings ysettings = uiySettingsConverter.convert(analysisForm.getYsettings()); List<JudgmentSeriesCriteria> judgmentSeriesCriteriaList = judgmentSeriesFilterConverter.convertList(analysisForm.getGlobalFilter(), analysisForm.getSeriesFilters()); Chart<Object, Number> chart = chartService.generateChart(judgmentSeriesCriteriaList, xsettings, ysettings); return chart; }
ChartGenerator { public Chart<Object, Number> generateChart(ChartCode chartCode, AnalysisForm analysisForm) { Preconditions.checkNotNull(analysisForm); Preconditions.checkArgument(canGenerateChart(chartCode, analysisForm)); XSettingsGenerator xsettingsGenerator = xsettingsGeneratorManager.getXSettingsGenerator(chartCode); XSettings xsettings = xsettingsGenerator.generateXSettings(analysisForm.getGlobalFilter()); YSettings ysettings = uiySettingsConverter.convert(analysisForm.getYsettings()); List<JudgmentSeriesCriteria> judgmentSeriesCriteriaList = judgmentSeriesFilterConverter.convertList(analysisForm.getGlobalFilter(), analysisForm.getSeriesFilters()); Chart<Object, Number> chart = chartService.generateChart(judgmentSeriesCriteriaList, xsettings, ysettings); return chart; } }
ChartGenerator { public Chart<Object, Number> generateChart(ChartCode chartCode, AnalysisForm analysisForm) { Preconditions.checkNotNull(analysisForm); Preconditions.checkArgument(canGenerateChart(chartCode, analysisForm)); XSettingsGenerator xsettingsGenerator = xsettingsGeneratorManager.getXSettingsGenerator(chartCode); XSettings xsettings = xsettingsGenerator.generateXSettings(analysisForm.getGlobalFilter()); YSettings ysettings = uiySettingsConverter.convert(analysisForm.getYsettings()); List<JudgmentSeriesCriteria> judgmentSeriesCriteriaList = judgmentSeriesFilterConverter.convertList(analysisForm.getGlobalFilter(), analysisForm.getSeriesFilters()); Chart<Object, Number> chart = chartService.generateChart(judgmentSeriesCriteriaList, xsettings, ysettings); return chart; }  }
ChartGenerator { public Chart<Object, Number> generateChart(ChartCode chartCode, AnalysisForm analysisForm) { Preconditions.checkNotNull(analysisForm); Preconditions.checkArgument(canGenerateChart(chartCode, analysisForm)); XSettingsGenerator xsettingsGenerator = xsettingsGeneratorManager.getXSettingsGenerator(chartCode); XSettings xsettings = xsettingsGenerator.generateXSettings(analysisForm.getGlobalFilter()); YSettings ysettings = uiySettingsConverter.convert(analysisForm.getYsettings()); List<JudgmentSeriesCriteria> judgmentSeriesCriteriaList = judgmentSeriesFilterConverter.convertList(analysisForm.getGlobalFilter(), analysisForm.getSeriesFilters()); Chart<Object, Number> chart = chartService.generateChart(judgmentSeriesCriteriaList, xsettings, ysettings); return chart; }  Chart<Object, Number> generateChart(ChartCode chartCode, AnalysisForm analysisForm); boolean canGenerateChart(ChartCode chartCode, AnalysisForm analysisForm); @Autowired void setChartService(ChartService chartService); @Autowired void setJudgmentSeriesFilterConverter(JudgmentSeriesFilterConverter judgmentSeriesFilterConverter); @Autowired void setUiySettingsConverter(UiySettingsConverter uiySettingsConverter); @Autowired void setXsettingGeneratorManager(XSettingsGeneratorManager xsettingsGeneratorManager); }
ChartGenerator { public Chart<Object, Number> generateChart(ChartCode chartCode, AnalysisForm analysisForm) { Preconditions.checkNotNull(analysisForm); Preconditions.checkArgument(canGenerateChart(chartCode, analysisForm)); XSettingsGenerator xsettingsGenerator = xsettingsGeneratorManager.getXSettingsGenerator(chartCode); XSettings xsettings = xsettingsGenerator.generateXSettings(analysisForm.getGlobalFilter()); YSettings ysettings = uiySettingsConverter.convert(analysisForm.getYsettings()); List<JudgmentSeriesCriteria> judgmentSeriesCriteriaList = judgmentSeriesFilterConverter.convertList(analysisForm.getGlobalFilter(), analysisForm.getSeriesFilters()); Chart<Object, Number> chart = chartService.generateChart(judgmentSeriesCriteriaList, xsettings, ysettings); return chart; }  Chart<Object, Number> generateChart(ChartCode chartCode, AnalysisForm analysisForm); boolean canGenerateChart(ChartCode chartCode, AnalysisForm analysisForm); @Autowired void setChartService(ChartService chartService); @Autowired void setJudgmentSeriesFilterConverter(JudgmentSeriesFilterConverter judgmentSeriesFilterConverter); @Autowired void setUiySettingsConverter(UiySettingsConverter uiySettingsConverter); @Autowired void setXsettingGeneratorManager(XSettingsGeneratorManager xsettingsGeneratorManager);  }