JSONArray emailArray = result.getJSONArray(Person.Field.EMAILS.toString());
assertEquals(1, emailArray.length());
for (int i = 0; i < canonical.getEmails().size(); i++) {
ListField expectedEmail = canonical.getEmails().get(i);
JSONObject actualEmail = emailArray.getJSONObject(i);
assertEquals(expectedEmail.getType(),
actualEmail.getString(ListField.Field.TYPE.toString()));
assertEquals(expectedEmail.getValue(),
actualEmail.getString(ListField.Field.VALUE.toString()));
}
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),
result.getJSONArray(Person.Field.ORGANIZATIONS.toString()).getJSONObject(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(result, canonical.getLookingFor(),
Person.Field.LOOKING_FOR);
assertStringListField(result, canonical.getMovies(), Person.Field.MOVIES);
assertStringListField(result, canonical.getMusic(), Person.Field.MUSIC);
assertEquals(canonical.getName().getFormatted(),
result.getJSONObject(Person.Field.NAME.toString()).getString(
Name.Field.FORMATTED.toString()));
assertEnumField(result, canonical.getNetworkPresence(),
Person.Field.NETWORKPRESENCE);
assertStringField(result, canonical.getNickname(), Person.Field.NICKNAME);
assertStringField(result, canonical.getPets(), Person.Field.PETS);
JSONArray phoneArray = result.getJSONArray(
Person.Field.PHONE_NUMBERS.toString());
assertEquals(canonical.getPhoneNumbers().size(), phoneArray.length());
for (int i = 0; i < canonical.getPhoneNumbers().size(); i++) {
ListField expectedPhone = canonical.getPhoneNumbers().get(i);
JSONObject actualPhone = phoneArray.getJSONObject(i);
assertEquals(expectedPhone.getType(), actualPhone.getString(
ListField.Field.TYPE.toString()));
assertEquals(expectedPhone.getValue(), actualPhone.getString(
ListField.Field.VALUE.toString()));
}
assertStringField(result, canonical.getPoliticalViews(),
Person.Field.POLITICAL_VIEWS);