@Test public void specialityIsMapped() { Person person = this.personBuilder.speciality("Fotsvamp").speciality("Visdomständer").build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, this.unitCache); assertEquals("speciality", 2, result.getSpeciality().size()); }
@Test public void surnameIsMapped() { Person person = this.personBuilder.surname("Silfverstråle").build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, this.unitCache); assertEquals("surname", "Silfverstråle", result.getSurname()); }
@Test public void titleIsMapped() { Person person = this.personBuilder.title("Läkare").build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, this.unitCache); assertEquals("title", "Läkare", result.getTitle()); }
@Test public void hsaAltTextIsMapped() { Person person = this.personBuilder.hsaAltText("alternativ text").build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, this.unitCache); assertEquals("altText", "alternativ text", result.getAltText()); }
@Test public void userIdIsMapped() { Person person = this.personBuilder.userId("abc123").build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, this.unitCache); assertEquals("user id", "abc123", result.getUserId()); }
@Test public void hsaIdentityIsMapped() { Person person = this.personBuilder.hsaIdentity("abc-123").build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, this.unitCache); assertEquals("hsaIdentity", "abc-123", result.getHsaIdentity()); }
@Test public void paTitleNameIsMapped() { Person person = this.personBuilder.paTitleName("IT-ansvarig").build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, this.unitCache); assertEquals("titleName", "IT-ansvarig", result.getTitleName()); }
@Test public void givenNameIsMapped() { Person person = this.personBuilder.givenName("Karl").build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, this.unitCache); assertEquals("given name", "Karl", result.getGivenName()); }
@Test public void nickNameIsMapped() { Person person = this.personBuilder.nickName("Kalle").build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, this.unitCache); assertEquals("nick name", "Kalle", result.getNickName()); }
@Test public void middleNameIsMapped() { Person person = this.personBuilder.middleName("Johansson").build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, this.unitCache); assertEquals("middle name", "Johansson", result.getMiddleName()); }
@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 employmentLocalityIsMapped() { Employment employment = this.employmentBuilder.locality("Halmstad").build(); Person person = this.personBuilder.employment(employment).build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, this.unitCache); assertEquals("employment locality", "Halmstad", result.getEmployment().get(0).getLocality()); }
@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 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()); }
@Test public void internalPagerNumberIsMapped() { Employment employment = this.employmentBuilder .internalPagerNumber(PhoneNumber.createPhoneNumber("0300-12345")) .build(); Person person = this.personBuilder.employment(employment).build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, this.unitCache); List<TelephoneNumber> telephone = result.getEmployment().get(0).getTelephone(); assertEquals("internal pager number", 1, telephone.size()); assertEquals("label", "Personsökare", telephone.get(0).getLabel()); assertEquals("type", TelephoneType.OTHER, telephone.get(0).getType()); assertEquals("area code", "0300", telephone.get(0).getAreaCode()); assertEquals("telephone number", "123 45", telephone.get(0).getTelephoneNumber()); }
@Test public void publicTelephoneNumberIsMapped() { Employment employment = this.employmentBuilder .publicTelephoneNumber(PhoneNumber.createPhoneNumber("0300-12345")) .build(); Person person = this.personBuilder.employment(employment).build(); se.vgregion.kivtools.svc.sitemap.Person result = SitemapPersonMapper.map(person, this.unitCache); List<TelephoneNumber> telephone = result.getEmployment().get(0).getTelephone(); assertEquals("public telephone number", 1, telephone.size()); assertEquals("first label", "Telefon", 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()); }
@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()); }