@Test public void overwriteJudgment_TextContent() { JudgmentTextContent oldTextContent = new JudgmentTextContent(); oldTextContent.setRawTextContent("salkd;lad a;dlks; d;sadkl ;l3ke ;lk;l344343kk34j3jh4j3h43 "); oldTextContent.setType(ContentType.PDF); oldTextContent.setFilePath("/old/file/path.pdf"); oldJudgment.setTextContent(oldTextContent); JudgmentTextContent newTextContent = new JudgmentTextContent(); newTextContent.setRawTextContent("23232l32323230239 2030230293 029 302 3023\n03923"); newTextContent.setType(ContentType.DOC); newTextContent.setFilePath("/new/file/path.doc"); newJudgment.setTextContent(newTextContent); judgmentOverwriter.overwriteJudgment(oldJudgment, newJudgment, correctionList); assertEquals(newTextContent.getRawTextContent(), oldJudgment.getRawTextContent()); assertEquals(newTextContent.getType(), oldJudgment.getTextContent().getType()); assertEquals(newTextContent.getFilePath(), oldJudgment.getTextContent().getFilePath()); assertEquals(newTextContent.getRawTextContent(), newJudgment.getRawTextContent()); assertEquals(newTextContent.getType(), newJudgment.getTextContent().getType()); assertEquals(newTextContent.getFilePath(), newJudgment.getTextContent().getFilePath()); }
@Override public final void overwriteJudgment(Judgment oldJudgment, Judgment newJudgment, ImportCorrectionList correctionList) { Preconditions.checkNotNull(oldJudgment); Preconditions.checkNotNull(newJudgment); overwriteCourtCases(oldJudgment, newJudgment); oldJudgment.setJudgmentDate(newJudgment.getJudgmentDate()); overwriteCourtReporters(oldJudgment, newJudgment); oldJudgment.setDecision(newJudgment.getDecision()); oldJudgment.setJudgmentType(newJudgment.getJudgmentType()); overwriteLegalBases(oldJudgment, newJudgment); oldJudgment.setSummary(newJudgment.getSummary()); overwriteJudgmentTextContent(oldJudgment.getTextContent(), newJudgment.getTextContent()); overwriteSourceInfo(oldJudgment.getSourceInfo(), newJudgment.getSourceInfo()); overwriteJudges(oldJudgment, newJudgment, correctionList); overwriteReferencedRegulations(oldJudgment, newJudgment); oldJudgment.setReceiptDate(newJudgment.getReceiptDate()); oldJudgment.setMeansOfAppeal(newJudgment.getMeansOfAppeal()); oldJudgment.setJudgmentResult(newJudgment.getJudgmentResult()); overwriteLowerCourtJudgments(oldJudgment, newJudgment); }
CommonJudgmentOverwriter implements JudgmentOverwriter<Judgment> { @Override public final void overwriteJudgment(Judgment oldJudgment, Judgment newJudgment, ImportCorrectionList correctionList) { Preconditions.checkNotNull(oldJudgment); Preconditions.checkNotNull(newJudgment); overwriteCourtCases(oldJudgment, newJudgment); oldJudgment.setJudgmentDate(newJudgment.getJudgmentDate()); overwriteCourtReporters(oldJudgment, newJudgment); oldJudgment.setDecision(newJudgment.getDecision()); oldJudgment.setJudgmentType(newJudgment.getJudgmentType()); overwriteLegalBases(oldJudgment, newJudgment); oldJudgment.setSummary(newJudgment.getSummary()); overwriteJudgmentTextContent(oldJudgment.getTextContent(), newJudgment.getTextContent()); overwriteSourceInfo(oldJudgment.getSourceInfo(), newJudgment.getSourceInfo()); overwriteJudges(oldJudgment, newJudgment, correctionList); overwriteReferencedRegulations(oldJudgment, newJudgment); oldJudgment.setReceiptDate(newJudgment.getReceiptDate()); oldJudgment.setMeansOfAppeal(newJudgment.getMeansOfAppeal()); oldJudgment.setJudgmentResult(newJudgment.getJudgmentResult()); overwriteLowerCourtJudgments(oldJudgment, newJudgment); } }
CommonJudgmentOverwriter implements JudgmentOverwriter<Judgment> { @Override public final void overwriteJudgment(Judgment oldJudgment, Judgment newJudgment, ImportCorrectionList correctionList) { Preconditions.checkNotNull(oldJudgment); Preconditions.checkNotNull(newJudgment); overwriteCourtCases(oldJudgment, newJudgment); oldJudgment.setJudgmentDate(newJudgment.getJudgmentDate()); overwriteCourtReporters(oldJudgment, newJudgment); oldJudgment.setDecision(newJudgment.getDecision()); oldJudgment.setJudgmentType(newJudgment.getJudgmentType()); overwriteLegalBases(oldJudgment, newJudgment); oldJudgment.setSummary(newJudgment.getSummary()); overwriteJudgmentTextContent(oldJudgment.getTextContent(), newJudgment.getTextContent()); overwriteSourceInfo(oldJudgment.getSourceInfo(), newJudgment.getSourceInfo()); overwriteJudges(oldJudgment, newJudgment, correctionList); overwriteReferencedRegulations(oldJudgment, newJudgment); oldJudgment.setReceiptDate(newJudgment.getReceiptDate()); oldJudgment.setMeansOfAppeal(newJudgment.getMeansOfAppeal()); oldJudgment.setJudgmentResult(newJudgment.getJudgmentResult()); overwriteLowerCourtJudgments(oldJudgment, newJudgment); }  }
CommonJudgmentOverwriter implements JudgmentOverwriter<Judgment> { @Override public final void overwriteJudgment(Judgment oldJudgment, Judgment newJudgment, ImportCorrectionList correctionList) { Preconditions.checkNotNull(oldJudgment); Preconditions.checkNotNull(newJudgment); overwriteCourtCases(oldJudgment, newJudgment); oldJudgment.setJudgmentDate(newJudgment.getJudgmentDate()); overwriteCourtReporters(oldJudgment, newJudgment); oldJudgment.setDecision(newJudgment.getDecision()); oldJudgment.setJudgmentType(newJudgment.getJudgmentType()); overwriteLegalBases(oldJudgment, newJudgment); oldJudgment.setSummary(newJudgment.getSummary()); overwriteJudgmentTextContent(oldJudgment.getTextContent(), newJudgment.getTextContent()); overwriteSourceInfo(oldJudgment.getSourceInfo(), newJudgment.getSourceInfo()); overwriteJudges(oldJudgment, newJudgment, correctionList); overwriteReferencedRegulations(oldJudgment, newJudgment); oldJudgment.setReceiptDate(newJudgment.getReceiptDate()); oldJudgment.setMeansOfAppeal(newJudgment.getMeansOfAppeal()); oldJudgment.setJudgmentResult(newJudgment.getJudgmentResult()); overwriteLowerCourtJudgments(oldJudgment, newJudgment); }  @Override final void overwriteJudgment(Judgment oldJudgment, Judgment newJudgment, ImportCorrectionList correctionList); }
CommonJudgmentOverwriter implements JudgmentOverwriter<Judgment> { @Override public final void overwriteJudgment(Judgment oldJudgment, Judgment newJudgment, ImportCorrectionList correctionList) { Preconditions.checkNotNull(oldJudgment); Preconditions.checkNotNull(newJudgment); overwriteCourtCases(oldJudgment, newJudgment); oldJudgment.setJudgmentDate(newJudgment.getJudgmentDate()); overwriteCourtReporters(oldJudgment, newJudgment); oldJudgment.setDecision(newJudgment.getDecision()); oldJudgment.setJudgmentType(newJudgment.getJudgmentType()); overwriteLegalBases(oldJudgment, newJudgment); oldJudgment.setSummary(newJudgment.getSummary()); overwriteJudgmentTextContent(oldJudgment.getTextContent(), newJudgment.getTextContent()); overwriteSourceInfo(oldJudgment.getSourceInfo(), newJudgment.getSourceInfo()); overwriteJudges(oldJudgment, newJudgment, correctionList); overwriteReferencedRegulations(oldJudgment, newJudgment); oldJudgment.setReceiptDate(newJudgment.getReceiptDate()); oldJudgment.setMeansOfAppeal(newJudgment.getMeansOfAppeal()); oldJudgment.setJudgmentResult(newJudgment.getJudgmentResult()); overwriteLowerCourtJudgments(oldJudgment, newJudgment); }  @Override final void overwriteJudgment(Judgment oldJudgment, Judgment newJudgment, ImportCorrectionList correctionList);  }