@Test public void generateXSettings() { JudgmentGlobalFilter globalFilter = new JudgmentGlobalFilter(); MonthYearRange monthYearRange = new MonthYearRange(); globalFilter.setJudgmentDateRange(monthYearRange); XDateRange xDateRange = new XDateRange(new LocalDate(2000, 1, 1), new LocalDate(2011, 12, 31), new Period(2, PeriodUnit.MONTH)); when(monthYearRangeConverter.convert(monthYearRange)).thenReturn(xDateRange); XSettings xsettings = xsettingsGenerator.generateXSettings(globalFilter); assertNotNull(xsettings); assertEquals(xDateRange, xsettings.getRange()); assertEquals(XField.JUDGMENT_DATE, xsettings.getField()); }
@Override public XSettings generateXSettings(JudgmentGlobalFilter judgmentGlobalFilter) { Preconditions.checkArgument(canGenerateXSettings(judgmentGlobalFilter)); XSettings xsettings = new XSettings(); xsettings.setRange(monthYearRangeConverter.convert(judgmentGlobalFilter.getJudgmentDateRange())); xsettings.setField(XField.JUDGMENT_DATE); return xsettings; }
MainChartXSettingsGenerator implements XSettingsGenerator { @Override public XSettings generateXSettings(JudgmentGlobalFilter judgmentGlobalFilter) { Preconditions.checkArgument(canGenerateXSettings(judgmentGlobalFilter)); XSettings xsettings = new XSettings(); xsettings.setRange(monthYearRangeConverter.convert(judgmentGlobalFilter.getJudgmentDateRange())); xsettings.setField(XField.JUDGMENT_DATE); return xsettings; } }
MainChartXSettingsGenerator implements XSettingsGenerator { @Override public XSettings generateXSettings(JudgmentGlobalFilter judgmentGlobalFilter) { Preconditions.checkArgument(canGenerateXSettings(judgmentGlobalFilter)); XSettings xsettings = new XSettings(); xsettings.setRange(monthYearRangeConverter.convert(judgmentGlobalFilter.getJudgmentDateRange())); xsettings.setField(XField.JUDGMENT_DATE); return xsettings; }  }
MainChartXSettingsGenerator implements XSettingsGenerator { @Override public XSettings generateXSettings(JudgmentGlobalFilter judgmentGlobalFilter) { Preconditions.checkArgument(canGenerateXSettings(judgmentGlobalFilter)); XSettings xsettings = new XSettings(); xsettings.setRange(monthYearRangeConverter.convert(judgmentGlobalFilter.getJudgmentDateRange())); xsettings.setField(XField.JUDGMENT_DATE); return xsettings; }  @Override XSettings generateXSettings(JudgmentGlobalFilter judgmentGlobalFilter); @Override boolean canGenerateXSettings(JudgmentGlobalFilter judgmentGlobalFilter); @Override boolean handles(ChartCode chartCode); @Autowired void setMonthYearRangeConverter(MonthYearRangeConverter monthYearRangeConverter); }
MainChartXSettingsGenerator implements XSettingsGenerator { @Override public XSettings generateXSettings(JudgmentGlobalFilter judgmentGlobalFilter) { Preconditions.checkArgument(canGenerateXSettings(judgmentGlobalFilter)); XSettings xsettings = new XSettings(); xsettings.setRange(monthYearRangeConverter.convert(judgmentGlobalFilter.getJudgmentDateRange())); xsettings.setField(XField.JUDGMENT_DATE); return xsettings; }  @Override XSettings generateXSettings(JudgmentGlobalFilter judgmentGlobalFilter); @Override boolean canGenerateXSettings(JudgmentGlobalFilter judgmentGlobalFilter); @Override boolean handles(ChartCode chartCode); @Autowired void setMonthYearRangeConverter(MonthYearRangeConverter monthYearRangeConverter);  }