@Test(expected=Exception.class) public void convert_IncorrectFieldValue() { String courtAreaFieldValue = "123_124Sąd Okręgowy w Poznaniu"; when(fieldValuePrefixAdder.extractFieldValue(courtAreaFieldValue)).thenReturn("124Sąd Okręgowy w Poznaniu"); ccCourtAreaFieldValueConverter.convert(courtAreaFieldValue); }
public CcCourtArea convert(String ccCourtAreaFieldValue) { Preconditions.checkNotNull(ccCourtAreaFieldValue); String courtAreaStr = fieldValuePrefixAdder.extractFieldValue(ccCourtAreaFieldValue); String name = courtAreaStr.split(CcCourtAreaFieldValueCreator.CC_COURT_AREA_VALUE_PART_SEPARATOR)[0]; long courtId = Long.parseLong(courtAreaStr.split(CcCourtAreaFieldValueCreator.CC_COURT_AREA_VALUE_PART_SEPARATOR)[1]); CcCourtArea ccCourtArea = new CcCourtArea(); ccCourtArea.setCourtId(courtId); ccCourtArea.setName(name); return ccCourtArea; }
CcCourtAreaFieldValueConverter { public CcCourtArea convert(String ccCourtAreaFieldValue) { Preconditions.checkNotNull(ccCourtAreaFieldValue); String courtAreaStr = fieldValuePrefixAdder.extractFieldValue(ccCourtAreaFieldValue); String name = courtAreaStr.split(CcCourtAreaFieldValueCreator.CC_COURT_AREA_VALUE_PART_SEPARATOR)[0]; long courtId = Long.parseLong(courtAreaStr.split(CcCourtAreaFieldValueCreator.CC_COURT_AREA_VALUE_PART_SEPARATOR)[1]); CcCourtArea ccCourtArea = new CcCourtArea(); ccCourtArea.setCourtId(courtId); ccCourtArea.setName(name); return ccCourtArea; } }
CcCourtAreaFieldValueConverter { public CcCourtArea convert(String ccCourtAreaFieldValue) { Preconditions.checkNotNull(ccCourtAreaFieldValue); String courtAreaStr = fieldValuePrefixAdder.extractFieldValue(ccCourtAreaFieldValue); String name = courtAreaStr.split(CcCourtAreaFieldValueCreator.CC_COURT_AREA_VALUE_PART_SEPARATOR)[0]; long courtId = Long.parseLong(courtAreaStr.split(CcCourtAreaFieldValueCreator.CC_COURT_AREA_VALUE_PART_SEPARATOR)[1]); CcCourtArea ccCourtArea = new CcCourtArea(); ccCourtArea.setCourtId(courtId); ccCourtArea.setName(name); return ccCourtArea; }  }
CcCourtAreaFieldValueConverter { public CcCourtArea convert(String ccCourtAreaFieldValue) { Preconditions.checkNotNull(ccCourtAreaFieldValue); String courtAreaStr = fieldValuePrefixAdder.extractFieldValue(ccCourtAreaFieldValue); String name = courtAreaStr.split(CcCourtAreaFieldValueCreator.CC_COURT_AREA_VALUE_PART_SEPARATOR)[0]; long courtId = Long.parseLong(courtAreaStr.split(CcCourtAreaFieldValueCreator.CC_COURT_AREA_VALUE_PART_SEPARATOR)[1]); CcCourtArea ccCourtArea = new CcCourtArea(); ccCourtArea.setCourtId(courtId); ccCourtArea.setName(name); return ccCourtArea; }  CcCourtArea convert(String ccCourtAreaFieldValue); }
CcCourtAreaFieldValueConverter { public CcCourtArea convert(String ccCourtAreaFieldValue) { Preconditions.checkNotNull(ccCourtAreaFieldValue); String courtAreaStr = fieldValuePrefixAdder.extractFieldValue(ccCourtAreaFieldValue); String name = courtAreaStr.split(CcCourtAreaFieldValueCreator.CC_COURT_AREA_VALUE_PART_SEPARATOR)[0]; long courtId = Long.parseLong(courtAreaStr.split(CcCourtAreaFieldValueCreator.CC_COURT_AREA_VALUE_PART_SEPARATOR)[1]); CcCourtArea ccCourtArea = new CcCourtArea(); ccCourtArea.setCourtId(courtId); ccCourtArea.setName(name); return ccCourtArea; }  CcCourtArea convert(String ccCourtAreaFieldValue);  }