@Test public void canGenerateXSettings_FALSE_EmptyCourtCriteria() { JudgmentGlobalFilter globalFilter = new JudgmentGlobalFilter(); assertFalse(xsettingsGenerator.canGenerateXSettings(globalFilter)); }
@Override public boolean canGenerateXSettings(JudgmentGlobalFilter judgmentGlobalFilter) { Preconditions.checkNotNull(judgmentGlobalFilter); CourtCriteria courtCriteria = judgmentGlobalFilter.getCourtCriteria(); if (CourtType.COMMON != courtCriteria.getCourtType()) { return false; } if (courtCriteria.getCcCourtId() == null) { return true; }; if (!courtCriteria.isCcIncludeDependentCourtJudgments()) { return false; } CommonCourt commonCourt = commonCourtRepository.findOne(courtCriteria.getCcCourtId()); if (CommonCourtType.DISTRICT == commonCourt.getType()) { return false; } return true; }
CcCourtChartXSettingsGenerator implements XSettingsGenerator { @Override public boolean canGenerateXSettings(JudgmentGlobalFilter judgmentGlobalFilter) { Preconditions.checkNotNull(judgmentGlobalFilter); CourtCriteria courtCriteria = judgmentGlobalFilter.getCourtCriteria(); if (CourtType.COMMON != courtCriteria.getCourtType()) { return false; } if (courtCriteria.getCcCourtId() == null) { return true; }; if (!courtCriteria.isCcIncludeDependentCourtJudgments()) { return false; } CommonCourt commonCourt = commonCourtRepository.findOne(courtCriteria.getCcCourtId()); if (CommonCourtType.DISTRICT == commonCourt.getType()) { return false; } return true; } }
CcCourtChartXSettingsGenerator implements XSettingsGenerator { @Override public boolean canGenerateXSettings(JudgmentGlobalFilter judgmentGlobalFilter) { Preconditions.checkNotNull(judgmentGlobalFilter); CourtCriteria courtCriteria = judgmentGlobalFilter.getCourtCriteria(); if (CourtType.COMMON != courtCriteria.getCourtType()) { return false; } if (courtCriteria.getCcCourtId() == null) { return true; }; if (!courtCriteria.isCcIncludeDependentCourtJudgments()) { return false; } CommonCourt commonCourt = commonCourtRepository.findOne(courtCriteria.getCcCourtId()); if (CommonCourtType.DISTRICT == commonCourt.getType()) { return false; } return true; }  }
CcCourtChartXSettingsGenerator implements XSettingsGenerator { @Override public boolean canGenerateXSettings(JudgmentGlobalFilter judgmentGlobalFilter) { Preconditions.checkNotNull(judgmentGlobalFilter); CourtCriteria courtCriteria = judgmentGlobalFilter.getCourtCriteria(); if (CourtType.COMMON != courtCriteria.getCourtType()) { return false; } if (courtCriteria.getCcCourtId() == null) { return true; }; if (!courtCriteria.isCcIncludeDependentCourtJudgments()) { return false; } CommonCourt commonCourt = commonCourtRepository.findOne(courtCriteria.getCcCourtId()); if (CommonCourtType.DISTRICT == commonCourt.getType()) { return false; } return true; }  @Override XSettings generateXSettings(JudgmentGlobalFilter judgmentGlobalFilter); @Override boolean canGenerateXSettings(JudgmentGlobalFilter judgmentGlobalFilter); @Override boolean handles(ChartCode chartCode); @Autowired void setCommonCourtRepository(CommonCourtRepository commonCourtRepository); }
CcCourtChartXSettingsGenerator implements XSettingsGenerator { @Override public boolean canGenerateXSettings(JudgmentGlobalFilter judgmentGlobalFilter) { Preconditions.checkNotNull(judgmentGlobalFilter); CourtCriteria courtCriteria = judgmentGlobalFilter.getCourtCriteria(); if (CourtType.COMMON != courtCriteria.getCourtType()) { return false; } if (courtCriteria.getCcCourtId() == null) { return true; }; if (!courtCriteria.isCcIncludeDependentCourtJudgments()) { return false; } CommonCourt commonCourt = commonCourtRepository.findOne(courtCriteria.getCcCourtId()); if (CommonCourtType.DISTRICT == commonCourt.getType()) { return false; } return true; }  @Override XSettings generateXSettings(JudgmentGlobalFilter judgmentGlobalFilter); @Override boolean canGenerateXSettings(JudgmentGlobalFilter judgmentGlobalFilter); @Override boolean handles(ChartCode chartCode); @Autowired void setCommonCourtRepository(CommonCourtRepository commonCourtRepository);  }