@Test public void convertJudgment_extractJudges() { List<Judge> judges = Lists.newArrayList(new Judge("Jan Nowak"), new Judge("Adam Kowalski", JudgeRole.PRESIDING_JUDGE, JudgeRole.REPORTING_JUDGE)); when(judgmentDataExtractor.extractJudges(eq(sourceJudgment), any(ImportCorrectionList.class))).thenReturn(judges); judgmentConverter.convertJudgment(sourceJudgment); assertEquals(judges.size(), judgment.getJudges().size()); Judge janNowak = judgment.getJudge("Jan Nowak"); assertTrue(judges.get(0) == janNowak); Judge adamKowalski = judgment.getJudge("Adam Kowalski"); assertTrue(judges.get(1) == adamKowalski); }
public final JudgmentWithCorrectionList<JUDGMENT> convertJudgment(SOURCE_JUDGMENT sourceJudgment) { JUDGMENT judgment = judgmentDataExtractor.createNewJudgment(); ImportCorrectionList correctionList = new ImportCorrectionList(); convertCourtCases(judgment, sourceJudgment, correctionList); judgment.setJudgmentDate(judgmentDataExtractor.extractJudgmentDate(sourceJudgment, correctionList)); convertCourtReporters(judgment, sourceJudgment, correctionList); judgment.setDecision(judgmentDataExtractor.extractDecision(sourceJudgment, correctionList)); judgment.setSummary(judgmentDataExtractor.extractSummary(sourceJudgment, correctionList)); convertLegalBases(judgment, sourceJudgment, correctionList); judgment.setTextContent(judgmentDataExtractor.extractTextContent(sourceJudgment, correctionList)); judgment.setSourceInfo(extractSourceInfo(sourceJudgment, correctionList)); judgment.setJudgmentType(judgmentDataExtractor.extractJudgmentType(sourceJudgment, correctionList)); convertReferencedRegulations(judgment, sourceJudgment, correctionList); convertJudges(judgment, sourceJudgment, correctionList); judgment.setReceiptDate(judgmentDataExtractor.extractReceiptDate(sourceJudgment, correctionList)); convertLowerCourtJudgments(judgment, sourceJudgment, correctionList); judgment.setMeansOfAppeal(judgmentDataExtractor.extractMeansOfAppeal(sourceJudgment, correctionList)); judgment.setJudgmentResult(judgmentDataExtractor.extractJudgmentResult(sourceJudgment, correctionList)); judgmentDataExtractor.convertSpecific(judgment, sourceJudgment, correctionList); JudgmentWithCorrectionList<JUDGMENT> judgmentWithCorrectionList = new JudgmentWithCorrectionList<>(judgment, correctionList); return judgmentWithCorrectionList; }
JudgmentConverterImpl implements JudgmentConverter<JUDGMENT, SOURCE_JUDGMENT> { public final JudgmentWithCorrectionList<JUDGMENT> convertJudgment(SOURCE_JUDGMENT sourceJudgment) { JUDGMENT judgment = judgmentDataExtractor.createNewJudgment(); ImportCorrectionList correctionList = new ImportCorrectionList(); convertCourtCases(judgment, sourceJudgment, correctionList); judgment.setJudgmentDate(judgmentDataExtractor.extractJudgmentDate(sourceJudgment, correctionList)); convertCourtReporters(judgment, sourceJudgment, correctionList); judgment.setDecision(judgmentDataExtractor.extractDecision(sourceJudgment, correctionList)); judgment.setSummary(judgmentDataExtractor.extractSummary(sourceJudgment, correctionList)); convertLegalBases(judgment, sourceJudgment, correctionList); judgment.setTextContent(judgmentDataExtractor.extractTextContent(sourceJudgment, correctionList)); judgment.setSourceInfo(extractSourceInfo(sourceJudgment, correctionList)); judgment.setJudgmentType(judgmentDataExtractor.extractJudgmentType(sourceJudgment, correctionList)); convertReferencedRegulations(judgment, sourceJudgment, correctionList); convertJudges(judgment, sourceJudgment, correctionList); judgment.setReceiptDate(judgmentDataExtractor.extractReceiptDate(sourceJudgment, correctionList)); convertLowerCourtJudgments(judgment, sourceJudgment, correctionList); judgment.setMeansOfAppeal(judgmentDataExtractor.extractMeansOfAppeal(sourceJudgment, correctionList)); judgment.setJudgmentResult(judgmentDataExtractor.extractJudgmentResult(sourceJudgment, correctionList)); judgmentDataExtractor.convertSpecific(judgment, sourceJudgment, correctionList); JudgmentWithCorrectionList<JUDGMENT> judgmentWithCorrectionList = new JudgmentWithCorrectionList<>(judgment, correctionList); return judgmentWithCorrectionList; } }
JudgmentConverterImpl implements JudgmentConverter<JUDGMENT, SOURCE_JUDGMENT> { public final JudgmentWithCorrectionList<JUDGMENT> convertJudgment(SOURCE_JUDGMENT sourceJudgment) { JUDGMENT judgment = judgmentDataExtractor.createNewJudgment(); ImportCorrectionList correctionList = new ImportCorrectionList(); convertCourtCases(judgment, sourceJudgment, correctionList); judgment.setJudgmentDate(judgmentDataExtractor.extractJudgmentDate(sourceJudgment, correctionList)); convertCourtReporters(judgment, sourceJudgment, correctionList); judgment.setDecision(judgmentDataExtractor.extractDecision(sourceJudgment, correctionList)); judgment.setSummary(judgmentDataExtractor.extractSummary(sourceJudgment, correctionList)); convertLegalBases(judgment, sourceJudgment, correctionList); judgment.setTextContent(judgmentDataExtractor.extractTextContent(sourceJudgment, correctionList)); judgment.setSourceInfo(extractSourceInfo(sourceJudgment, correctionList)); judgment.setJudgmentType(judgmentDataExtractor.extractJudgmentType(sourceJudgment, correctionList)); convertReferencedRegulations(judgment, sourceJudgment, correctionList); convertJudges(judgment, sourceJudgment, correctionList); judgment.setReceiptDate(judgmentDataExtractor.extractReceiptDate(sourceJudgment, correctionList)); convertLowerCourtJudgments(judgment, sourceJudgment, correctionList); judgment.setMeansOfAppeal(judgmentDataExtractor.extractMeansOfAppeal(sourceJudgment, correctionList)); judgment.setJudgmentResult(judgmentDataExtractor.extractJudgmentResult(sourceJudgment, correctionList)); judgmentDataExtractor.convertSpecific(judgment, sourceJudgment, correctionList); JudgmentWithCorrectionList<JUDGMENT> judgmentWithCorrectionList = new JudgmentWithCorrectionList<>(judgment, correctionList); return judgmentWithCorrectionList; }  }
JudgmentConverterImpl implements JudgmentConverter<JUDGMENT, SOURCE_JUDGMENT> { public final JudgmentWithCorrectionList<JUDGMENT> convertJudgment(SOURCE_JUDGMENT sourceJudgment) { JUDGMENT judgment = judgmentDataExtractor.createNewJudgment(); ImportCorrectionList correctionList = new ImportCorrectionList(); convertCourtCases(judgment, sourceJudgment, correctionList); judgment.setJudgmentDate(judgmentDataExtractor.extractJudgmentDate(sourceJudgment, correctionList)); convertCourtReporters(judgment, sourceJudgment, correctionList); judgment.setDecision(judgmentDataExtractor.extractDecision(sourceJudgment, correctionList)); judgment.setSummary(judgmentDataExtractor.extractSummary(sourceJudgment, correctionList)); convertLegalBases(judgment, sourceJudgment, correctionList); judgment.setTextContent(judgmentDataExtractor.extractTextContent(sourceJudgment, correctionList)); judgment.setSourceInfo(extractSourceInfo(sourceJudgment, correctionList)); judgment.setJudgmentType(judgmentDataExtractor.extractJudgmentType(sourceJudgment, correctionList)); convertReferencedRegulations(judgment, sourceJudgment, correctionList); convertJudges(judgment, sourceJudgment, correctionList); judgment.setReceiptDate(judgmentDataExtractor.extractReceiptDate(sourceJudgment, correctionList)); convertLowerCourtJudgments(judgment, sourceJudgment, correctionList); judgment.setMeansOfAppeal(judgmentDataExtractor.extractMeansOfAppeal(sourceJudgment, correctionList)); judgment.setJudgmentResult(judgmentDataExtractor.extractJudgmentResult(sourceJudgment, correctionList)); judgmentDataExtractor.convertSpecific(judgment, sourceJudgment, correctionList); JudgmentWithCorrectionList<JUDGMENT> judgmentWithCorrectionList = new JudgmentWithCorrectionList<>(judgment, correctionList); return judgmentWithCorrectionList; }  final JudgmentWithCorrectionList<JUDGMENT> convertJudgment(SOURCE_JUDGMENT sourceJudgment); void setJudgmentDataExtractor(JudgmentDataExtractor<JUDGMENT, SOURCE_JUDGMENT> judgmentDataExtractor); }
JudgmentConverterImpl implements JudgmentConverter<JUDGMENT, SOURCE_JUDGMENT> { public final JudgmentWithCorrectionList<JUDGMENT> convertJudgment(SOURCE_JUDGMENT sourceJudgment) { JUDGMENT judgment = judgmentDataExtractor.createNewJudgment(); ImportCorrectionList correctionList = new ImportCorrectionList(); convertCourtCases(judgment, sourceJudgment, correctionList); judgment.setJudgmentDate(judgmentDataExtractor.extractJudgmentDate(sourceJudgment, correctionList)); convertCourtReporters(judgment, sourceJudgment, correctionList); judgment.setDecision(judgmentDataExtractor.extractDecision(sourceJudgment, correctionList)); judgment.setSummary(judgmentDataExtractor.extractSummary(sourceJudgment, correctionList)); convertLegalBases(judgment, sourceJudgment, correctionList); judgment.setTextContent(judgmentDataExtractor.extractTextContent(sourceJudgment, correctionList)); judgment.setSourceInfo(extractSourceInfo(sourceJudgment, correctionList)); judgment.setJudgmentType(judgmentDataExtractor.extractJudgmentType(sourceJudgment, correctionList)); convertReferencedRegulations(judgment, sourceJudgment, correctionList); convertJudges(judgment, sourceJudgment, correctionList); judgment.setReceiptDate(judgmentDataExtractor.extractReceiptDate(sourceJudgment, correctionList)); convertLowerCourtJudgments(judgment, sourceJudgment, correctionList); judgment.setMeansOfAppeal(judgmentDataExtractor.extractMeansOfAppeal(sourceJudgment, correctionList)); judgment.setJudgmentResult(judgmentDataExtractor.extractJudgmentResult(sourceJudgment, correctionList)); judgmentDataExtractor.convertSpecific(judgment, sourceJudgment, correctionList); JudgmentWithCorrectionList<JUDGMENT> judgmentWithCorrectionList = new JudgmentWithCorrectionList<>(judgment, correctionList); return judgmentWithCorrectionList; }  final JudgmentWithCorrectionList<JUDGMENT> convertJudgment(SOURCE_JUDGMENT sourceJudgment); void setJudgmentDataExtractor(JudgmentDataExtractor<JUDGMENT, SOURCE_JUDGMENT> judgmentDataExtractor);  }