use of oasis.names.tc.ebxml_regrep.xsd.rim._3.PersonType in project ddf by codice.
the class RegistryPackageTypeHelperTest method testGetPersonsFromRegistryObjectList.
@Test
public void testGetPersonsFromRegistryObjectList() throws Exception {
RegistryObjectListType registryObjectList = ((RegistryPackageType) registryObject).getRegistryObjectList();
List<PersonType> persons = rptHelper.getPersons(registryObjectList);
assertPersons(persons);
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.PersonType in project ddf by codice.
the class RegistryPackageTypeHelperTest method assertPersons.
private void assertPersons(List<PersonType> persons) {
// Values from xml file
int expectedPersonsSize = 3;
int expectedSize = 1;
String expectedFirstName = "john";
String expectedMiddleName = "middleName";
String expectedLastname = "doe";
String expectedCity = "Phoenix";
String expectedCountry = "USA";
String expectedPostalCode = "85037";
String expectedState = "AZ";
String expectedStreet = "1234 Some Street";
String expectedAreaCode = "111";
String expectedNumber = "111-1111";
String expectedExtension = "1234";
String expectedCountryCode = "country";
String expectedPhoneType = "cell phone";
String expectedEmail = "emailaddress@something.com";
assertThat(persons, hasSize(expectedPersonsSize));
PersonType person = persons.get(0);
assertThat(person.isSetPersonName(), is(true));
assertPersonName(person.getPersonName(), expectedFirstName, expectedMiddleName, expectedLastname);
assertThat(person.isSetAddress(), is(true));
List<PostalAddressType> addresses = person.getAddress();
assertThat(addresses, hasSize(expectedSize));
assertAddress(addresses.get(0), expectedCity, expectedCountry, expectedPostalCode, expectedState, expectedStreet);
assertThat(person.isSetTelephoneNumber(), is(true));
List<TelephoneNumberType> phoneNumbers = person.getTelephoneNumber();
assertThat(phoneNumbers, hasSize(expectedSize));
assertPhoneNumbers(phoneNumbers.get(0), expectedAreaCode, expectedNumber, expectedExtension, expectedCountryCode, expectedPhoneType);
assertThat(person.isSetEmailAddress(), is(true));
assertThat(person.getEmailAddress(), hasSize(expectedSize));
List<EmailAddressType> emailAddresses = person.getEmailAddress();
assertThat(emailAddresses.get(0).getAddress(), is(equalTo(expectedEmail)));
}
Aggregations