@Test public void streetAddressIsMapped() { Employment employment = employmentBuilder.streetAddress(createAddress("Storgatan 1", "412 63", "Göteborg")).build(); Person person = personBuilder.employment(employment).build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache); assertEquals("address", 1, result.getEmployment().get(0).getAddress().size()); se.vgregion.kivtools.svc.sitemap.Address address = result.getEmployment().get(0).getAddress().get(0); assertEquals("label", "Besöksadress", address.getLabel()); assertEquals("type", AddressType.VISIT, address.getType()); }
@Test public void consigneeAddressIsMapped() { Employment employment = this.employmentBuilder .consigneeAddress(this.createAddress("Storgatan 1", "412 63", "Göteborg")) .build(); Person person = this.personBuilder.employment(employment).build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, this.unitCache); assertEquals("address", 1, result.getEmployment().get(0).getAddress().size()); se.vgregion.kivtools.svc.sitemap.Address address = result.getEmployment().get(0).getAddress().get(0); assertEquals("label", "Godsadress", address.getLabel()); assertEquals("type", AddressType.GOODS, address.getType()); }
@Test public void postalAddressIsMapped() { Employment employment = employmentBuilder.postalAddress(createAddress("Storgatan 1", "412 63", "Göteborg")).build(); Person person = personBuilder.employment(employment).build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache); assertEquals("address", 1, result.getEmployment().get(0).getAddress().size()); se.vgregion.kivtools.svc.sitemap.Address address = result.getEmployment().get(0).getAddress().get(0); assertEquals("label", "Postadress", address.getLabel()); assertEquals("type", AddressType.POST, address.getType()); assertFalse("concatenated", address.isConcatenated()); assertEquals("street", "Storgatan 1", address.getStreet()); assertEquals("post code", "412 63", address.getPostcode()); assertEquals("city", "Göteborg", address.getCity()); }