@Test public void emptySifDemographicShouldMapToNullBirthDataValues() { openadk.library.common.Demographics sifDemographics = new openadk.library.common.Demographics(); BirthData sliBirthData = converter.convert(sifDemographics); Assert.assertNotNull(sliBirthData); Assert.assertNull(sliBirthData.getCityOfBirth()); Assert.assertNull(sliBirthData.getCountryOfBirthCode()); Assert.assertNull(sliBirthData.getStateOfBirthAbbreviation()); Assert.assertNull(sliBirthData.getBirthDate()); Assert.assertNull(sliBirthData.getDateEnteredUS()); }
public BirthData convert(Demographics sifDemographics) { if (sifDemographics == null) { return null; } BirthData sliBirthData = new BirthData(); sliBirthData.setCountryOfBirthCode(sifDemographics.getCountryOfBirth()); sliBirthData.setCityOfBirth(sifDemographics.getPlaceOfBirth()); if (SLI_STATE_CODES.contains(sifDemographics.getStateOfBirth())) { sliBirthData.setStateOfBirthAbbreviation(sifDemographics.getStateOfBirth()); } SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); if (sifDemographics.getBirthDate() != null) { sliBirthData.setBirthDate(dateFormat.format(sifDemographics.getBirthDate().getTime())); } if (sifDemographics.getCountryArrivalDate() != null) { sliBirthData.setDateEnteredUS(dateFormat.format(sifDemographics.getCountryArrivalDate().getTime())); } return sliBirthData; }
DemographicsToBirthDataConverter { public BirthData convert(Demographics sifDemographics) { if (sifDemographics == null) { return null; } BirthData sliBirthData = new BirthData(); sliBirthData.setCountryOfBirthCode(sifDemographics.getCountryOfBirth()); sliBirthData.setCityOfBirth(sifDemographics.getPlaceOfBirth()); if (SLI_STATE_CODES.contains(sifDemographics.getStateOfBirth())) { sliBirthData.setStateOfBirthAbbreviation(sifDemographics.getStateOfBirth()); } SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); if (sifDemographics.getBirthDate() != null) { sliBirthData.setBirthDate(dateFormat.format(sifDemographics.getBirthDate().getTime())); } if (sifDemographics.getCountryArrivalDate() != null) { sliBirthData.setDateEnteredUS(dateFormat.format(sifDemographics.getCountryArrivalDate().getTime())); } return sliBirthData; } }
DemographicsToBirthDataConverter { public BirthData convert(Demographics sifDemographics) { if (sifDemographics == null) { return null; } BirthData sliBirthData = new BirthData(); sliBirthData.setCountryOfBirthCode(sifDemographics.getCountryOfBirth()); sliBirthData.setCityOfBirth(sifDemographics.getPlaceOfBirth()); if (SLI_STATE_CODES.contains(sifDemographics.getStateOfBirth())) { sliBirthData.setStateOfBirthAbbreviation(sifDemographics.getStateOfBirth()); } SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); if (sifDemographics.getBirthDate() != null) { sliBirthData.setBirthDate(dateFormat.format(sifDemographics.getBirthDate().getTime())); } if (sifDemographics.getCountryArrivalDate() != null) { sliBirthData.setDateEnteredUS(dateFormat.format(sifDemographics.getCountryArrivalDate().getTime())); } return sliBirthData; }  }
DemographicsToBirthDataConverter { public BirthData convert(Demographics sifDemographics) { if (sifDemographics == null) { return null; } BirthData sliBirthData = new BirthData(); sliBirthData.setCountryOfBirthCode(sifDemographics.getCountryOfBirth()); sliBirthData.setCityOfBirth(sifDemographics.getPlaceOfBirth()); if (SLI_STATE_CODES.contains(sifDemographics.getStateOfBirth())) { sliBirthData.setStateOfBirthAbbreviation(sifDemographics.getStateOfBirth()); } SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); if (sifDemographics.getBirthDate() != null) { sliBirthData.setBirthDate(dateFormat.format(sifDemographics.getBirthDate().getTime())); } if (sifDemographics.getCountryArrivalDate() != null) { sliBirthData.setDateEnteredUS(dateFormat.format(sifDemographics.getCountryArrivalDate().getTime())); } return sliBirthData; }  BirthData convert(Demographics sifDemographics); }
DemographicsToBirthDataConverter { public BirthData convert(Demographics sifDemographics) { if (sifDemographics == null) { return null; } BirthData sliBirthData = new BirthData(); sliBirthData.setCountryOfBirthCode(sifDemographics.getCountryOfBirth()); sliBirthData.setCityOfBirth(sifDemographics.getPlaceOfBirth()); if (SLI_STATE_CODES.contains(sifDemographics.getStateOfBirth())) { sliBirthData.setStateOfBirthAbbreviation(sifDemographics.getStateOfBirth()); } SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); if (sifDemographics.getBirthDate() != null) { sliBirthData.setBirthDate(dateFormat.format(sifDemographics.getBirthDate().getTime())); } if (sifDemographics.getCountryArrivalDate() != null) { sliBirthData.setDateEnteredUS(dateFormat.format(sifDemographics.getCountryArrivalDate().getTime())); } return sliBirthData; }  BirthData convert(Demographics sifDemographics);  }