@Test public void convertToJudgmentCorrection_Update_Judgment() { String oldJudgmentType = "XXX"; ImportCorrection correctionJudgmentType = createUpdate(judgment).ofProperty(JUDGMENT_TYPE).oldValue(oldJudgmentType).newValue(judgment.getJudgmentType().name()).build(); JudgmentCorrection judgmentCorrection = correctionConverter.convertToJudgmentCorrection(judgment, correctionJudgmentType); JudgmentCorrection expectedJudgmentCorrection = JudgmentCorrectionBuilder.createFor(judgment) .update(judgment) .property(JUDGMENT_TYPE) .oldValue(oldJudgmentType).newValue(judgment.getJudgmentType().name()) .build(); assertEquals(expectedJudgmentCorrection, judgmentCorrection); }
public JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection) { Preconditions.checkNotNull(importCorrection); Preconditions.checkNotNull(judgment); JudgmentCorrectionBuilder jCorrectionBuilder = JudgmentCorrectionBuilder.createFor(judgment); if (importCorrection.getChangeOperation().equals(ChangeOperation.UPDATE)) { jCorrectionBuilder.update(getCorrectedObject(importCorrection, judgment)); } else if (importCorrection.getChangeOperation().equals(ChangeOperation.CREATE)) { jCorrectionBuilder.create(getCorrectedObject(importCorrection, judgment)); } else { jCorrectionBuilder.delete(importCorrection.getDeletedObjectClass()); } return jCorrectionBuilder.property(importCorrection.getCorrectedProperty()) .oldValue(importCorrection.getOldValue()) .newValue(importCorrection.getNewValue()) .build(); }
ImportCorrectionConverter { public JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection) { Preconditions.checkNotNull(importCorrection); Preconditions.checkNotNull(judgment); JudgmentCorrectionBuilder jCorrectionBuilder = JudgmentCorrectionBuilder.createFor(judgment); if (importCorrection.getChangeOperation().equals(ChangeOperation.UPDATE)) { jCorrectionBuilder.update(getCorrectedObject(importCorrection, judgment)); } else if (importCorrection.getChangeOperation().equals(ChangeOperation.CREATE)) { jCorrectionBuilder.create(getCorrectedObject(importCorrection, judgment)); } else { jCorrectionBuilder.delete(importCorrection.getDeletedObjectClass()); } return jCorrectionBuilder.property(importCorrection.getCorrectedProperty()) .oldValue(importCorrection.getOldValue()) .newValue(importCorrection.getNewValue()) .build(); } }
ImportCorrectionConverter { public JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection) { Preconditions.checkNotNull(importCorrection); Preconditions.checkNotNull(judgment); JudgmentCorrectionBuilder jCorrectionBuilder = JudgmentCorrectionBuilder.createFor(judgment); if (importCorrection.getChangeOperation().equals(ChangeOperation.UPDATE)) { jCorrectionBuilder.update(getCorrectedObject(importCorrection, judgment)); } else if (importCorrection.getChangeOperation().equals(ChangeOperation.CREATE)) { jCorrectionBuilder.create(getCorrectedObject(importCorrection, judgment)); } else { jCorrectionBuilder.delete(importCorrection.getDeletedObjectClass()); } return jCorrectionBuilder.property(importCorrection.getCorrectedProperty()) .oldValue(importCorrection.getOldValue()) .newValue(importCorrection.getNewValue()) .build(); }  }
ImportCorrectionConverter { public JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection) { Preconditions.checkNotNull(importCorrection); Preconditions.checkNotNull(judgment); JudgmentCorrectionBuilder jCorrectionBuilder = JudgmentCorrectionBuilder.createFor(judgment); if (importCorrection.getChangeOperation().equals(ChangeOperation.UPDATE)) { jCorrectionBuilder.update(getCorrectedObject(importCorrection, judgment)); } else if (importCorrection.getChangeOperation().equals(ChangeOperation.CREATE)) { jCorrectionBuilder.create(getCorrectedObject(importCorrection, judgment)); } else { jCorrectionBuilder.delete(importCorrection.getDeletedObjectClass()); } return jCorrectionBuilder.property(importCorrection.getCorrectedProperty()) .oldValue(importCorrection.getOldValue()) .newValue(importCorrection.getNewValue()) .build(); }  JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection); List<JudgmentCorrection> convertToJudgmentCorrections(Judgment judgment, List<ImportCorrection> importCorrections); }
ImportCorrectionConverter { public JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection) { Preconditions.checkNotNull(importCorrection); Preconditions.checkNotNull(judgment); JudgmentCorrectionBuilder jCorrectionBuilder = JudgmentCorrectionBuilder.createFor(judgment); if (importCorrection.getChangeOperation().equals(ChangeOperation.UPDATE)) { jCorrectionBuilder.update(getCorrectedObject(importCorrection, judgment)); } else if (importCorrection.getChangeOperation().equals(ChangeOperation.CREATE)) { jCorrectionBuilder.create(getCorrectedObject(importCorrection, judgment)); } else { jCorrectionBuilder.delete(importCorrection.getDeletedObjectClass()); } return jCorrectionBuilder.property(importCorrection.getCorrectedProperty()) .oldValue(importCorrection.getOldValue()) .newValue(importCorrection.getNewValue()) .build(); }  JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection); List<JudgmentCorrection> convertToJudgmentCorrections(Judgment judgment, List<ImportCorrection> importCorrections);  }