@Test public void convertToType_POSTANOWIENIE_TO_DECISION() { String judgmentFormName = " nowe postanowienie siedmiu SN"; setFormNameNormalizerMockToNotChanging(judgmentFormName); JudgmentType judgmentType = scJudgmentFormConverter.convertToJudgmentType(judgmentFormName, correctionList); assertEquals(JudgmentType.DECISION, judgmentType); assertEquals(0, correctionList.getNumberOfCorrections()); }
public JudgmentType convertToJudgmentType(String judgmentFormName, ImportCorrectionList correctionList) { JudgmentType judgmentType = null; String normalizedJudgmentFormName = scJudgmentFormNameNormalizer.normalize(judgmentFormName); judgmentType = getJudgmentType(normalizedJudgmentFormName); if (judgmentType == null || scJudgmentFormNameNormalizer.isChangedByNormalization(judgmentFormName)) { judgmentType = judgmentType==null? JudgmentType.SENTENCE: judgmentType; correctionList.addCorrection(createUpdate(null) .ofProperty(CorrectedProperty.JUDGMENT_TYPE) .oldValue(StringUtils.trim(judgmentFormName)) .newValue(judgmentType.name()) .build()); } return judgmentType; }
ScJudgmentFormConverter { public JudgmentType convertToJudgmentType(String judgmentFormName, ImportCorrectionList correctionList) { JudgmentType judgmentType = null; String normalizedJudgmentFormName = scJudgmentFormNameNormalizer.normalize(judgmentFormName); judgmentType = getJudgmentType(normalizedJudgmentFormName); if (judgmentType == null || scJudgmentFormNameNormalizer.isChangedByNormalization(judgmentFormName)) { judgmentType = judgmentType==null? JudgmentType.SENTENCE: judgmentType; correctionList.addCorrection(createUpdate(null) .ofProperty(CorrectedProperty.JUDGMENT_TYPE) .oldValue(StringUtils.trim(judgmentFormName)) .newValue(judgmentType.name()) .build()); } return judgmentType; } }
ScJudgmentFormConverter { public JudgmentType convertToJudgmentType(String judgmentFormName, ImportCorrectionList correctionList) { JudgmentType judgmentType = null; String normalizedJudgmentFormName = scJudgmentFormNameNormalizer.normalize(judgmentFormName); judgmentType = getJudgmentType(normalizedJudgmentFormName); if (judgmentType == null || scJudgmentFormNameNormalizer.isChangedByNormalization(judgmentFormName)) { judgmentType = judgmentType==null? JudgmentType.SENTENCE: judgmentType; correctionList.addCorrection(createUpdate(null) .ofProperty(CorrectedProperty.JUDGMENT_TYPE) .oldValue(StringUtils.trim(judgmentFormName)) .newValue(judgmentType.name()) .build()); } return judgmentType; }  }
ScJudgmentFormConverter { public JudgmentType convertToJudgmentType(String judgmentFormName, ImportCorrectionList correctionList) { JudgmentType judgmentType = null; String normalizedJudgmentFormName = scJudgmentFormNameNormalizer.normalize(judgmentFormName); judgmentType = getJudgmentType(normalizedJudgmentFormName); if (judgmentType == null || scJudgmentFormNameNormalizer.isChangedByNormalization(judgmentFormName)) { judgmentType = judgmentType==null? JudgmentType.SENTENCE: judgmentType; correctionList.addCorrection(createUpdate(null) .ofProperty(CorrectedProperty.JUDGMENT_TYPE) .oldValue(StringUtils.trim(judgmentFormName)) .newValue(judgmentType.name()) .build()); } return judgmentType; }  JudgmentType convertToJudgmentType(String judgmentFormName, ImportCorrectionList correctionList); void setJudgmentTypeMap(Map<String, JudgmentType> judgmentTypeMap); @Autowired void setScJudgmentFormNameNormalizer(ScJudgmentFormNameNormalizer scJudgmentFormNameNormalizer); }
ScJudgmentFormConverter { public JudgmentType convertToJudgmentType(String judgmentFormName, ImportCorrectionList correctionList) { JudgmentType judgmentType = null; String normalizedJudgmentFormName = scJudgmentFormNameNormalizer.normalize(judgmentFormName); judgmentType = getJudgmentType(normalizedJudgmentFormName); if (judgmentType == null || scJudgmentFormNameNormalizer.isChangedByNormalization(judgmentFormName)) { judgmentType = judgmentType==null? JudgmentType.SENTENCE: judgmentType; correctionList.addCorrection(createUpdate(null) .ofProperty(CorrectedProperty.JUDGMENT_TYPE) .oldValue(StringUtils.trim(judgmentFormName)) .newValue(judgmentType.name()) .build()); } return judgmentType; }  JudgmentType convertToJudgmentType(String judgmentFormName, ImportCorrectionList correctionList); void setJudgmentTypeMap(Map<String, JudgmentType> judgmentTypeMap); @Autowired void setScJudgmentFormNameNormalizer(ScJudgmentFormNameNormalizer scJudgmentFormNameNormalizer);  }