@Test(expected = IllegalArgumentException.class) public void populateThrowsExceptionIfSourceIsNull() { final Address target = new Address(); final AddressModel source = null; testObject.populate(source, target); }
@Override public void populate(final AddressModel source, final Address target) { validateParameterNotNull(source, "Parameter source (AddressModel) cannot be null"); target.setAddress1(StringEscapeUtils.escapeXml(source.getLine1())); target.setAddress2(StringEscapeUtils.escapeXml(source.getLine2())); target.setCity(StringEscapeUtils.escapeXml(source.getTown())); if (source.getCountry() != null) { target.setCountryCode(source.getCountry().getIsocode()); } target.setFirstName(StringEscapeUtils.escapeXml(source.getFirstname())); target.setLastName(StringEscapeUtils.escapeXml(source.getLastname())); target.setPostalCode(StringEscapeUtils.escapeXml(source.getPostalcode())); target.setTelephoneNumber(source.getPhone1()); if (source.getRegion() != null) { target.setState(source.getRegion().getIsocode()); } }
WorldpayAddressPopulator implements Populator<AddressModel, Address> { @Override public void populate(final AddressModel source, final Address target) { validateParameterNotNull(source, "Parameter source (AddressModel) cannot be null"); target.setAddress1(StringEscapeUtils.escapeXml(source.getLine1())); target.setAddress2(StringEscapeUtils.escapeXml(source.getLine2())); target.setCity(StringEscapeUtils.escapeXml(source.getTown())); if (source.getCountry() != null) { target.setCountryCode(source.getCountry().getIsocode()); } target.setFirstName(StringEscapeUtils.escapeXml(source.getFirstname())); target.setLastName(StringEscapeUtils.escapeXml(source.getLastname())); target.setPostalCode(StringEscapeUtils.escapeXml(source.getPostalcode())); target.setTelephoneNumber(source.getPhone1()); if (source.getRegion() != null) { target.setState(source.getRegion().getIsocode()); } } }
WorldpayAddressPopulator implements Populator<AddressModel, Address> { @Override public void populate(final AddressModel source, final Address target) { validateParameterNotNull(source, "Parameter source (AddressModel) cannot be null"); target.setAddress1(StringEscapeUtils.escapeXml(source.getLine1())); target.setAddress2(StringEscapeUtils.escapeXml(source.getLine2())); target.setCity(StringEscapeUtils.escapeXml(source.getTown())); if (source.getCountry() != null) { target.setCountryCode(source.getCountry().getIsocode()); } target.setFirstName(StringEscapeUtils.escapeXml(source.getFirstname())); target.setLastName(StringEscapeUtils.escapeXml(source.getLastname())); target.setPostalCode(StringEscapeUtils.escapeXml(source.getPostalcode())); target.setTelephoneNumber(source.getPhone1()); if (source.getRegion() != null) { target.setState(source.getRegion().getIsocode()); } }  }
WorldpayAddressPopulator implements Populator<AddressModel, Address> { @Override public void populate(final AddressModel source, final Address target) { validateParameterNotNull(source, "Parameter source (AddressModel) cannot be null"); target.setAddress1(StringEscapeUtils.escapeXml(source.getLine1())); target.setAddress2(StringEscapeUtils.escapeXml(source.getLine2())); target.setCity(StringEscapeUtils.escapeXml(source.getTown())); if (source.getCountry() != null) { target.setCountryCode(source.getCountry().getIsocode()); } target.setFirstName(StringEscapeUtils.escapeXml(source.getFirstname())); target.setLastName(StringEscapeUtils.escapeXml(source.getLastname())); target.setPostalCode(StringEscapeUtils.escapeXml(source.getPostalcode())); target.setTelephoneNumber(source.getPhone1()); if (source.getRegion() != null) { target.setState(source.getRegion().getIsocode()); } }  @Override void populate(final AddressModel source, final Address target); }
WorldpayAddressPopulator implements Populator<AddressModel, Address> { @Override public void populate(final AddressModel source, final Address target) { validateParameterNotNull(source, "Parameter source (AddressModel) cannot be null"); target.setAddress1(StringEscapeUtils.escapeXml(source.getLine1())); target.setAddress2(StringEscapeUtils.escapeXml(source.getLine2())); target.setCity(StringEscapeUtils.escapeXml(source.getTown())); if (source.getCountry() != null) { target.setCountryCode(source.getCountry().getIsocode()); } target.setFirstName(StringEscapeUtils.escapeXml(source.getFirstname())); target.setLastName(StringEscapeUtils.escapeXml(source.getLastname())); target.setPostalCode(StringEscapeUtils.escapeXml(source.getPostalcode())); target.setTelephoneNumber(source.getPhone1()); if (source.getRegion() != null) { target.setState(source.getRegion().getIsocode()); } }  @Override void populate(final AddressModel source, final Address target);  }