Search in sources :

Example 11 with PersonType

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);
}
Also used : RegistryObjectListType(oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryObjectListType) RegistryPackageType(oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType) PersonType(oasis.names.tc.ebxml_regrep.xsd.rim._3.PersonType) Test(org.junit.Test)

Example 12 with PersonType

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)));
}
Also used : TelephoneNumberType(oasis.names.tc.ebxml_regrep.xsd.rim._3.TelephoneNumberType) PersonType(oasis.names.tc.ebxml_regrep.xsd.rim._3.PersonType) EmailAddressType(oasis.names.tc.ebxml_regrep.xsd.rim._3.EmailAddressType) PostalAddressType(oasis.names.tc.ebxml_regrep.xsd.rim._3.PostalAddressType)

Aggregations

PersonType (oasis.names.tc.ebxml_regrep.xsd.rim._3.PersonType)10 OrganizationType (oasis.names.tc.ebxml_regrep.xsd.rim._3.OrganizationType)5 ArrayList (java.util.ArrayList)4 ExtrinsicObjectType (oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType)4 ServiceType (oasis.names.tc.ebxml_regrep.xsd.rim._3.ServiceType)4 HashMap (java.util.HashMap)3 AssociationType1 (oasis.names.tc.ebxml_regrep.xsd.rim._3.AssociationType1)3 EmailAddressType (oasis.names.tc.ebxml_regrep.xsd.rim._3.EmailAddressType)3 RegistryObjectListType (oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryObjectListType)3 RegistryObjectType (oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryObjectType)3 RegistryPackageType (oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType)3 TelephoneNumberType (oasis.names.tc.ebxml_regrep.xsd.rim._3.TelephoneNumberType)3 Map (java.util.Map)2 PostalAddressType (oasis.names.tc.ebxml_regrep.xsd.rim._3.PostalAddressType)2 Test (org.junit.Test)2 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1 JAXBElement (javax.xml.bind.JAXBElement)1 PersonNameType (oasis.names.tc.ebxml_regrep.xsd.rim._3.PersonNameType)1