WorldpayBillingInfoAddressPopulator implements Populator<BillingInfo, Address> { @Override public void populate(final BillingInfo source, final Address target) throws ConversionException { target.setAddress1(source.getStreet1()); target.setAddress2(source.getStreet2()); target.setFirstName(source.getFirstName()); target.setLastName(source.getLastName()); target.setCity(source.getCity()); target.setCountryCode(source.getCountry()); target.setState(source.getState()); target.setTelephoneNumber(source.getPhoneNumber()); target.setPostalCode(source.getPostalCode()); }  @Override void populate(final BillingInfo source, final Address target);  }
@Test public void populateShouldAddFirstNameOnAddressInformation() { testObj.populate(billingInfo, address); assertEquals(FIRST_NAME, address.getFirstName()); }
@Test public void populateShouldAddLastNameOnAddressInformation() { testObj.populate(billingInfo, address); assertEquals(LAST_NAME, address.getLastName()); }
@Test public void populateShouldAddAddress1OnAddressInformation() { testObj.populate(billingInfo, address); assertEquals(ADDRESS_1, address.getAddress1()); }
@Test public void populateShouldAddAddress2OnAddressInformation() { testObj.populate(billingInfo, address); assertEquals(ADDRESS_2, address.getAddress2()); }
@Test public void populateShouldAddPostalCodeOnAddressInformation() { testObj.populate(billingInfo, address); assertEquals(POSTAL_CODE, address.getPostalCode()); }
@Test public void populateShouldAddCityOnAddressInformation() { testObj.populate(billingInfo, address); assertEquals(CITY, address.getCity()); }
@Test public void populateShouldAddStateOnAddressInformation() { testObj.populate(billingInfo, address); assertEquals(STATE, address.getState()); }
@Test public void populateShouldAddCountryCodeOnAddressInformation() { testObj.populate(billingInfo, address); assertEquals(COUNTRY_CODE, address.getCountryCode()); }
@Test public void populateShouldAddPhoneNumberOnAddressInformation() { testObj.populate(billingInfo, address); assertEquals(PHONE_NUMBER, address.getTelephoneNumber()); }