@Test public void convert() { String sep = CcCourtAreaFieldValueCreator.CC_COURT_AREA_VALUE_PART_SEPARATOR; String courtAreaFieldValue = "123_Sąd Okręgowy w Poznaniu"+sep+"124"; when(fieldValuePrefixAdder.extractFieldValue(courtAreaFieldValue)).thenReturn("Sąd Okręgowy w Poznaniu"+sep+"124"); CcCourtArea ccCourtArea = ccCourtAreaFieldValueConverter.convert(courtAreaFieldValue); assertNotNull(ccCourtArea); assertEquals(124L, ccCourtArea.getCourtId()); assertEquals("Sąd Okręgowy w Poznaniu", ccCourtArea.getName()); }
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);  }