@Test
 public void employmentTitleIsMapped() {
   Employment employment = employmentBuilder.title("Systemarkitekt").build();
   Person person = personBuilder.employment(employment).build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   assertEquals("employment title", "Systemarkitekt", result.getEmployment().get(0).getTitle());
 }
 @Test
 public void employmentsAreMapped() {
   Employment employment = employmentBuilder.build();
   Person person = personBuilder.employment(employment).build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   assertEquals("employments", 1, result.getEmployment().size());
 }
 @Test
 public void emailIsMapped() {
   Person person = personBuilder.email("*****@*****.**").build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   assertEquals("ealias", 1, result.getEAlias().size());
   assertEquals("alias", "*****@*****.**", result.getEAlias().get(0).getAlias());
   assertEquals("label", "E-post", result.getEAlias().get(0).getLabel());
   assertEquals("type", EAliasType.E_MAIL, result.getEAlias().get(0).getType());
 }
 @Test
 public void employmentUnitIdentityIsMapped() {
   Employment employment =
       employmentBuilder.unitDn("ou=Tandreglering Halmstad,ou=lthalland.se,o=lth").build();
   Person person = personBuilder.employment(employment).build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   assertEquals(
       "employment unit identity", "abc-123", result.getEmployment().get(0).getUnitIdentity());
 }
 @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 faxNumberIsMapped() {
   Employment employment =
       employmentBuilder.faxNumber(PhoneNumber.createPhoneNumber("0300-12345")).build();
   Person person = personBuilder.employment(employment).build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   List<TelephoneNumber> telephone = result.getEmployment().get(0).getTelephone();
   assertEquals("fax number", 1, telephone.size());
   assertEquals("label", "Fax", telephone.get(0).getLabel());
   assertEquals("type", TelephoneType.FAX, telephone.get(0).getType());
   assertEquals("area code", "0300", telephone.get(0).getAreaCode());
   assertEquals("telephone number", "123 45", telephone.get(0).getTelephoneNumber());
 }
 @Test
 public void telephoneTimesAreMapped() throws InvalidFormatException {
   Employment employment =
       employmentBuilder
           .telephoneTime(new WeekdayTime("1-4#08:30#10:00"))
           .telephoneTime(new WeekdayTime("5-5#08:00#11:00"))
           .build();
   Person person = personBuilder.employment(employment).build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   assertEquals(
       "telephone time",
       "Måndag-Torsdag 08:30-10:00, Fredag 08:00-11:00",
       result.getEmployment().get(0).getTelephoneTime());
 }
 @Test
 public void employmentDescriptionIsMapped() {
   Employment employment =
       employmentBuilder
           .description("Övergripande ansvar för systemdesign m.m.")
           .description("Kodslav")
           .build();
   Person person = personBuilder.employment(employment).build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   assertEquals(
       "employment title",
       "Övergripande ansvar för systemdesign m.m., Kodslav",
       result.getEmployment().get(0).getDescription());
 }
 @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());
 }
 @Test
 public void directPhoneNumberIsMapped() {
   Employment employment =
       employmentBuilder
           .telephoneNumber(PhoneNumber.createPhoneNumber("0300-12345"))
           .telephoneNumber(PhoneNumber.createPhoneNumber("0340-67890"))
           .build();
   Person person = personBuilder.employment(employment).build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   List<TelephoneNumber> telephone = result.getEmployment().get(0).getTelephone();
   assertEquals("direct phone number", 2, telephone.size());
   assertEquals("first label", "Direkttelefon", telephone.get(0).getLabel());
   assertEquals("first type", TelephoneType.FIXED, telephone.get(0).getType());
   assertEquals("first area code", "0300", telephone.get(0).getAreaCode());
   assertEquals("first telephone number", "123 45", telephone.get(0).getTelephoneNumber());
   assertEquals("second label", "Direkttelefon", telephone.get(1).getLabel());
   assertEquals("second type", TelephoneType.FIXED, telephone.get(1).getType());
   assertEquals("second area code", "0340", telephone.get(1).getAreaCode());
   assertEquals("second telephone number", "678 90", telephone.get(1).getTelephoneNumber());
 }
 @Test
 public void middleNameIsMapped() {
   Person person = personBuilder.middleName("Johansson").build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   assertEquals("middle name", "Johansson", result.getMiddleName());
 }
 @Test
 public void nickNameIsMapped() {
   Person person = personBuilder.nickName("Kalle").build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   assertEquals("nick name", "Kalle", result.getNickName());
 }
 @Test
 public void givenNameIsMapped() {
   Person person = personBuilder.givenName("Karl").build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   assertEquals("given name", "Karl", result.getGivenName());
 }
 @Test
 public void hsaIdentityIsMapped() {
   Person person = personBuilder.hsaIdentity("abc-123").build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   assertEquals("hsaIdentity", "abc-123", result.getHsaIdentity());
 }
 @Test
 public void specialityIsMapped() {
   Person person = personBuilder.speciality("Fotsvamp").speciality("Visdomständer").build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   assertEquals("speciality", 2, result.getSpeciality().size());
 }
 @Test
 public void surnameIsMapped() {
   Person person = personBuilder.surname("Silfverstråle").build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   assertEquals("surname", "Silfverstråle", result.getSurname());
 }
 @Test
 public void userIdIsMapped() {
   Person person = personBuilder.userId("abc123").build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   assertEquals("user id", "abc123", result.getUserId());
 }
 @Test
 public void titleIsMapped() {
   Person person = personBuilder.title("Läkare").build();
   se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, unitCache);
   assertEquals("title", "Läkare", result.getTitle());
 }