List<Node> emailArray = childNodeMap.get(Person.Field.EMAILS.toString());
assertEquals(1, emailArray.size());
for (int i = 0; i < canonical.getEmails().size(); i++) {
ListField expectedEmail = canonical.getEmails().get(i);
Map<String, List<String>> actualEmail = childNodesToMap(emailArray.get(i));
assertStringField(actualEmail, expectedEmail.getType(),
ListField.Field.TYPE);
assertStringField(actualEmail, expectedEmail.getValue(),
ListField.Field.VALUE);
}
assertStringField(result, canonical.getEthnicity(), Person.Field.ETHNICITY);
assertStringField(result, canonical.getFashion(), Person.Field.FASHION);
assertStringListField(result, canonical.getFood(), Person.Field.FOOD);
assertStringField(result, canonical.getGender().toString(),
Person.Field.GENDER);
assertStringField(result, canonical.getHappiestWhen(),
Person.Field.HAPPIEST_WHEN);
assertBooleanField(result, canonical.getHasApp(), Person.Field.HAS_APP);
assertStringListField(result, canonical.getHeroes(), Person.Field.HEROES);
assertStringField(result, canonical.getHumor(), Person.Field.HUMOR);
assertStringField(result, canonical.getId(), Person.Field.ID);
assertStringListField(result, canonical.getInterests(),
Person.Field.INTERESTS);
assertStringField(result, canonical.getJobInterests(),
Person.Field.JOB_INTERESTS);
assertOrganizationField(canonical.getOrganizations().get(0), childNodeMap
.get(Person.Field.ORGANIZATIONS.toString()).get(0));
assertStringListField(result, canonical.getLanguagesSpoken(),
Person.Field.LANGUAGES_SPOKEN);
// assertDateField(result, canonical.getUpdated(),
// Person.Field.LAST_UPDATED);
assertStringField(result, canonical.getLivingArrangement(),
Person.Field.LIVING_ARRANGEMENT);
assertListEnumField(childNodeMap, canonical.getLookingFor(),
Person.Field.LOOKING_FOR);
assertStringListField(result, canonical.getMovies(), Person.Field.MOVIES);
assertStringListField(result, canonical.getMusic(), Person.Field.MUSIC);
assertEquals(canonical.getName().getFormatted(), childNodesToMap(
childNodeMap.get(Person.Field.NAME.toString()).get(0)).get(
Name.Field.FORMATTED.toString()).get(0));
assertEnumField(childNodeMap, canonical.getNetworkPresence(),
Person.Field.NETWORKPRESENCE);
assertStringField(result, canonical.getNickname(), Person.Field.NICKNAME);
assertStringField(result, canonical.getPets(), Person.Field.PETS);
List<Node> phoneArray = childNodeMap.get(Person.Field.PHONE_NUMBERS
.toString());
assertEquals(canonical.getPhoneNumbers().size(), phoneArray.size());
for (int i = 0; i < canonical.getPhoneNumbers().size(); i++) {
ListField expectedPhone = canonical.getPhoneNumbers().get(i);
Map<String, List<String>> actualPhone = childNodesToMap(phoneArray.get(i));
assertEquals(expectedPhone.getType(), actualPhone.get(
ListField.Field.TYPE.toString()).get(0));
assertEquals(expectedPhone.getValue(), actualPhone.get(
ListField.Field.VALUE.toString()).get(0));
}
assertStringField(result, canonical.getPoliticalViews(),
Person.Field.POLITICAL_VIEWS);