@Test public void convertJudgment_SameCorrectionListShouldBePassedToAllExtractingMethods() { JudgmentWithCorrectionList<Judgment> retJudgmentWithC = judgmentConverter.convertJudgment(sourceJudgment); ArgumentCaptor<ImportCorrectionList> argCorrectionList = ArgumentCaptor.forClass(ImportCorrectionList.class); verify(judgmentDataExtractor).extractCourtCases(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractCourtReporters(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractDecision(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractJudges(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractJudgmentDate(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractJudgmentType(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractLegalBases(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractPublicationDate(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractPublisher(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractReferencedRegulations(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractReviser(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractSourceJudgmentId(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractSourceJudgmentUrl(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractSummary(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractTextContent(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractReceiptDate(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractLowerCourtJudgments(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractMeansOfAppeal(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).extractJudgmentResult(eq(sourceJudgment), argCorrectionList.capture()); verify(judgmentDataExtractor).convertSpecific(eq(retJudgmentWithC.getJudgment()), eq(sourceJudgment), argCorrectionList.capture()); assertEquals(getNumberOfExtractMethods()+1, argCorrectionList.getAllValues().size()); argCorrectionList.getAllValues().stream().forEach(cl->assertTrue(cl == retJudgmentWithC.getCorrectionList())); }
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);  }