@Test public void convertToJudgmentCorrections() { String oldJudgeName = "Sédzia Jan Nowak"; Judge judge = new Judge("JanNowak"); Whitebox.setInternalState(judge, "id", 5); ImportCorrection correctionJudgeName = createUpdate(judge).ofProperty(NAME).oldValue(oldJudgeName).newValue(judge.getName()).build(); String oldJudgmentType = "XXX"; ImportCorrection correctionJudgmentType = createUpdate(judgment).ofProperty(JUDGMENT_TYPE).oldValue(oldJudgmentType).newValue(judgment.getJudgmentType().name()).build(); List<JudgmentCorrection> judgmentCorrections = correctionConverter.convertToJudgmentCorrections(judgment, Lists.newArrayList(correctionJudgeName, correctionJudgmentType)); JudgmentCorrection expectedJudgmentCorrectionJudgeName = createFor(judgment) .update(judge) .property(NAME) .oldValue(oldJudgeName).newValue(judge.getName()) .build(); JudgmentCorrection expectedJudgmentCorrectionJudgmentType = createFor(judgment) .update(judgment) .property(JUDGMENT_TYPE) .oldValue(oldJudgmentType).newValue(judgment.getJudgmentType().name()) .build(); assertEquals(2, judgmentCorrections.size()); assertThat(judgmentCorrections, Matchers.containsInAnyOrder(expectedJudgmentCorrectionJudgeName, expectedJudgmentCorrectionJudgmentType)); }
public List<JudgmentCorrection> convertToJudgmentCorrections(Judgment judgment, List<ImportCorrection> importCorrections) { return importCorrections.stream().map(c->convertToJudgmentCorrection(judgment, c)).collect(Collectors.toList()); }
ImportCorrectionConverter { public List<JudgmentCorrection> convertToJudgmentCorrections(Judgment judgment, List<ImportCorrection> importCorrections) { return importCorrections.stream().map(c->convertToJudgmentCorrection(judgment, c)).collect(Collectors.toList()); } }
ImportCorrectionConverter { public List<JudgmentCorrection> convertToJudgmentCorrections(Judgment judgment, List<ImportCorrection> importCorrections) { return importCorrections.stream().map(c->convertToJudgmentCorrection(judgment, c)).collect(Collectors.toList()); }  }
ImportCorrectionConverter { public List<JudgmentCorrection> convertToJudgmentCorrections(Judgment judgment, List<ImportCorrection> importCorrections) { return importCorrections.stream().map(c->convertToJudgmentCorrection(judgment, c)).collect(Collectors.toList()); }  JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection); List<JudgmentCorrection> convertToJudgmentCorrections(Judgment judgment, List<ImportCorrection> importCorrections); }
ImportCorrectionConverter { public List<JudgmentCorrection> convertToJudgmentCorrections(Judgment judgment, List<ImportCorrection> importCorrections) { return importCorrections.stream().map(c->convertToJudgmentCorrection(judgment, c)).collect(Collectors.toList()); }  JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection); List<JudgmentCorrection> convertToJudgmentCorrections(Judgment judgment, List<ImportCorrection> importCorrections);  }