Organization org = (Organization) orgIter.next();
System.out.println("Org name: " + printer.getName(org));
System.out.println("Org description: " + printer.getDescription(org));
System.out.println("Org key id: " + printer.getKey(org));
User user = org.getPrimaryContact();
System.out.println("Primary Contact Full Name : " + user.getPersonName().getFullName());
assertEquals("User name does not match", user.getPersonName().getFullName(), PERSON_NAME);
Collection<EmailAddress> emailAddresses = user.getEmailAddresses();
System.out.println("Found " + emailAddresses.size() + " email addresses.");
assertEquals("Should have found 1 email address, found " + emailAddresses.size(), 1, emailAddresses.size());
for (EmailAddress email : emailAddresses) {
System.out.println("Primary Contact email : " + email.getAddress());
assertEquals("Email should be " + EMAIL, EMAIL, email.getAddress());
}
Collection<PostalAddress> postalAddresses = user.getPostalAddresses();
System.out.println("Found " + postalAddresses.size() + " postal addresses.");
assertEquals("Should have found 1 postal address, found " + postalAddresses.size(), 1, postalAddresses.size());
for (PostalAddress postalAddress : postalAddresses) {
System.out.println("Postal Address is " + postalAddress);
assertEquals("Street number should be " + STREET_NUMBER, STREET_NUMBER, postalAddress.getStreetNumber());
assertEquals("Street should be " + STREET, STREET, postalAddress.getStreet());
assertEquals("City should be " + CITY, CITY, postalAddress.getCity());
assertEquals("State should be " + STATE, STATE, postalAddress.getStateOrProvince());
assertEquals("Country should be " + COUNTRY, COUNTRY, postalAddress.getCountry());
assertEquals("Postal code should be " + POSTAL_CODE, POSTAL_CODE, postalAddress.getPostalCode());
}
Collection<TelephoneNumber> numbers = user.getTelephoneNumbers(null);
System.out.println("Found " + numbers.size() + " telephone numbers.");
assertEquals("Should have found 1 phone number, found " + numbers.size(), 1, numbers.size());
for (TelephoneNumber tele : numbers) {
System.out.println("Phone number is " + tele.getNumber());
assertEquals("Telephone number should be " + PHONE_NUMBER, PHONE_NUMBER, tele.getNumber());