@Test public void overwriteJudgment_Judges_NameSameRolesChanged() { Judge annaNowakOld = new Judge("Anna Nowak", JudgeRole.PRESIDING_JUDGE); Judge janNowakOld = new Judge("Jan Nowak", JudgeRole.REPORTING_JUDGE); oldJudgment.addJudge(janNowakOld); oldJudgment.addJudge(annaNowakOld); Judge annaNowakNew = new Judge("Anna Nowak", JudgeRole.REPORTING_JUDGE); Judge janNowakNew = new Judge("Jan Nowak", JudgeRole.PRESIDING_JUDGE, JudgeRole.REASONS_FOR_JUDGMENT_AUTHOR); newJudgment.addJudge(annaNowakNew); newJudgment.addJudge(janNowakNew); judgmentOverwriter.overwriteJudgment(oldJudgment, newJudgment, correctionList); assertEquals(2, oldJudgment.getJudges().size()); assertTrue(annaNowakOld == oldJudgment.getJudge(annaNowakNew.getName())); assertTrue(janNowakOld == oldJudgment.getJudge(janNowakNew.getName())); assertThat(oldJudgment.getJudge(annaNowakNew.getName()).getSpecialRoles(), Matchers.containsInAnyOrder(JudgeRole.REPORTING_JUDGE)); assertThat(oldJudgment.getJudge(janNowakNew.getName()).getSpecialRoles(), Matchers.containsInAnyOrder(JudgeRole.PRESIDING_JUDGE, JudgeRole.REASONS_FOR_JUDGMENT_AUTHOR)); assertEquals(2, newJudgment.getJudges().size()); assertTrue(annaNowakNew == newJudgment.getJudge(annaNowakNew.getName())); assertTrue(janNowakNew == newJudgment.getJudge(janNowakNew.getName())); assertThat(newJudgment.getJudge(annaNowakNew.getName()).getSpecialRoles(), Matchers.containsInAnyOrder(JudgeRole.REPORTING_JUDGE)); assertThat(newJudgment.getJudge(janNowakNew.getName()).getSpecialRoles(), Matchers.containsInAnyOrder(JudgeRole.PRESIDING_JUDGE, JudgeRole.REASONS_FOR_JUDGMENT_AUTHOR)); }
@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);  }