Search in sources :

Example 66 with Person

use of com.alibaba.json.bvt.bug.Bug_for_issue_729.Person in project ORCID-Source by ORCID.

the class PublicV2ApiServiceDelegatorImpl method viewPerson.

@Override
public Response viewPerson(String orcid) {
    Person person = personDetailsManagerReadOnly.getPublicPersonDetails(orcid);
    publicAPISecurityManagerV2.filter(person);
    ElementUtils.setPathToPerson(person, orcid);
    Api2_0_LastModifiedDatesHelper.calculateLastModified(person);
    sourceUtilsReadOnly.setSourceName(person);
    return Response.ok(person).build();
}
Also used : Person(org.orcid.jaxb.model.record_v2.Person)

Example 67 with Person

use of com.alibaba.json.bvt.bug.Bug_for_issue_729.Person in project ORCID-Source by ORCID.

the class MemberV2ApiServiceDelegatorImpl method viewPerson.

@Override
public Response viewPerson(String orcid) {
    Person person = personDetailsManagerReadOnly.getPersonDetails(orcid);
    orcidSecurityManager.checkAndFilter(orcid, person);
    ElementUtils.setPathToPerson(person, orcid);
    Api2_0_LastModifiedDatesHelper.calculateLastModified(person);
    sourceUtils.setSourceName(person);
    return Response.ok(person).build();
}
Also used : Person(org.orcid.jaxb.model.record_v2.Person)

Example 68 with Person

use of com.alibaba.json.bvt.bug.Bug_for_issue_729.Person in project ORCID-Source by ORCID.

the class PersonDetailsManagerTest method testGetPublicPersonDetails.

@Test
public void testGetPublicPersonDetails() {
    Person person = personDetailsManager.getPublicPersonDetails(ORCID);
    assertNotNull(person);
    assertNotNull(person.getExternalIdentifiers());
    assertNotNull(person.getExternalIdentifiers().getExternalIdentifiers());
    assertEquals(1, person.getExternalIdentifiers().getExternalIdentifiers().size());
    assertEquals(Long.valueOf(13), person.getExternalIdentifiers().getExternalIdentifiers().get(0).getPutCode());
    assertNotNull(person.getResearcherUrls());
    assertNotNull(person.getResearcherUrls().getResearcherUrls());
    assertEquals(1, person.getResearcherUrls().getResearcherUrls().size());
    assertEquals(Long.valueOf(13), person.getResearcherUrls().getResearcherUrls().get(0).getPutCode());
    assertNotNull(person.getOtherNames());
    assertNotNull(person.getOtherNames().getOtherNames());
    assertEquals(1, person.getOtherNames().getOtherNames().size());
    assertEquals(Long.valueOf(13), person.getOtherNames().getOtherNames().get(0).getPutCode());
    assertNotNull(person.getAddresses());
    assertNotNull(person.getAddresses().getAddress());
    assertEquals(1, person.getAddresses().getAddress().size());
    assertEquals(Long.valueOf(9), person.getAddresses().getAddress().get(0).getPutCode());
    assertNotNull(person.getKeywords());
    assertNotNull(person.getKeywords().getKeywords());
    assertEquals(1, person.getKeywords().getKeywords().size());
    assertEquals(Long.valueOf(9), person.getKeywords().getKeywords().get(0).getPutCode());
    assertNotNull(person.getEmails());
    assertNotNull(person.getEmails().getEmails());
    assertEquals(1, person.getEmails().getEmails().size());
    assertEquals("public_0000-0000-0000-0003@test.orcid.org", person.getEmails().getEmails().get(0).getEmail());
    assertNotNull(person.getBiography());
    assertEquals(Visibility.PUBLIC, person.getBiography().getVisibility());
    assertEquals("Biography for 0000-0000-0000-0003", person.getBiography().getContent());
    assertNotNull(person.getName());
    assertNotNull(person.getName().getCreditName());
    assertEquals("Credit Name", person.getName().getCreditName().getContent());
    assertNotNull(person.getName().getFamilyName());
    assertEquals("Family Name", person.getName().getFamilyName().getContent());
    assertNotNull(person.getName().getGivenNames());
    assertEquals("Given Names", person.getName().getGivenNames().getContent());
    assertEquals(Visibility.PUBLIC, person.getName().getVisibility());
}
Also used : Person(org.orcid.jaxb.model.record_v2.Person) Test(org.junit.Test) DBUnitTest(org.orcid.test.DBUnitTest)

Example 69 with Person

use of com.alibaba.json.bvt.bug.Bug_for_issue_729.Person in project ORCID-Source by ORCID.

the class RecordManagerTest method testGetRecord.

@Test
public void testGetRecord() {
    Record record = RecordManager.getRecord(ORCID);
    assertNotNull(record);
    assertNotNull(record.getActivitiesSummary());
    assertNotNull(record.getPerson());
    Person person = record.getPerson();
    assertNotNull(person.getExternalIdentifiers());
    assertNotNull(person.getExternalIdentifiers().getExternalIdentifiers());
    assertEquals(5, person.getExternalIdentifiers().getExternalIdentifiers().size());
    assertNotNull(person.getResearcherUrls());
    assertNotNull(person.getResearcherUrls().getResearcherUrls());
    assertEquals(5, person.getResearcherUrls().getResearcherUrls().size());
    assertNotNull(person.getOtherNames());
    assertNotNull(person.getOtherNames().getOtherNames());
    assertEquals(5, person.getOtherNames().getOtherNames().size());
    assertNotNull(person.getAddresses());
    assertNotNull(person.getAddresses().getAddress());
    assertEquals(5, person.getAddresses().getAddress().size());
    assertNotNull(person.getKeywords());
    assertNotNull(person.getKeywords().getKeywords());
    assertEquals(5, person.getKeywords().getKeywords().size());
    assertNotNull(person.getEmails());
    assertNotNull(person.getEmails().getEmails());
    assertEquals(5, person.getEmails().getEmails().size());
    assertNotNull(person.getBiography());
    assertEquals(Visibility.PUBLIC, person.getBiography().getVisibility());
    assertEquals("Biography for 0000-0000-0000-0003", person.getBiography().getContent());
    assertNotNull(person.getName());
    assertNotNull(person.getName().getCreditName());
    assertEquals("Credit Name", person.getName().getCreditName().getContent());
    assertNotNull(person.getName().getFamilyName());
    assertEquals("Family Name", person.getName().getFamilyName().getContent());
    assertNotNull(person.getName().getGivenNames());
    assertEquals("Given Names", person.getName().getGivenNames().getContent());
    assertEquals(Visibility.PUBLIC, person.getName().getVisibility());
    ActivitiesSummary activities = record.getActivitiesSummary();
    assertNotNull(activities);
    assertNotNull(activities.getEducations());
    assertNotNull(activities.getEducations().getSummaries());
    assertEquals(5, activities.getEducations().getSummaries().size());
    assertNotNull(activities.getEmployments());
    assertNotNull(activities.getEmployments().getSummaries());
    assertEquals(5, activities.getEmployments().getSummaries().size());
    assertNotNull(activities.getFundings());
    assertNotNull(activities.getFundings().getFundingGroup());
    assertEquals(5, activities.getFundings().getFundingGroup().size());
    assertNotNull(activities.getPeerReviews());
    assertNotNull(activities.getPeerReviews().getPeerReviewGroup());
    assertEquals(5, activities.getPeerReviews().getPeerReviewGroup().size());
    assertNotNull(activities.getWorks());
    assertNotNull(activities.getWorks().getWorkGroup());
    assertEquals(5, activities.getWorks().getWorkGroup().size());
}
Also used : Record(org.orcid.jaxb.model.record_v2.Record) Person(org.orcid.jaxb.model.record_v2.Person) ActivitiesSummary(org.orcid.jaxb.model.record.summary_v2.ActivitiesSummary) Test(org.junit.Test) DBUnitTest(org.orcid.test.DBUnitTest)

Example 70 with Person

use of com.alibaba.json.bvt.bug.Bug_for_issue_729.Person in project ORCID-Source by ORCID.

the class RecordManagerTest method testGetPublicRecord.

@Test
public void testGetPublicRecord() {
    Record record = RecordManager.getPublicRecord(ORCID);
    assertNotNull(record);
    assertNotNull(record.getActivitiesSummary());
    assertNotNull(record.getPerson());
    Person person = record.getPerson();
    assertNotNull(person);
    assertNotNull(person.getExternalIdentifiers());
    assertNotNull(person.getExternalIdentifiers().getExternalIdentifiers());
    assertEquals(1, person.getExternalIdentifiers().getExternalIdentifiers().size());
    assertEquals(Long.valueOf(13), person.getExternalIdentifiers().getExternalIdentifiers().get(0).getPutCode());
    assertNotNull(person.getResearcherUrls());
    assertNotNull(person.getResearcherUrls().getResearcherUrls());
    assertEquals(1, person.getResearcherUrls().getResearcherUrls().size());
    assertEquals(Long.valueOf(13), person.getResearcherUrls().getResearcherUrls().get(0).getPutCode());
    assertNotNull(person.getOtherNames());
    assertNotNull(person.getOtherNames().getOtherNames());
    assertEquals(1, person.getOtherNames().getOtherNames().size());
    assertEquals(Long.valueOf(13), person.getOtherNames().getOtherNames().get(0).getPutCode());
    assertNotNull(person.getAddresses());
    assertNotNull(person.getAddresses().getAddress());
    assertEquals(1, person.getAddresses().getAddress().size());
    assertEquals(Long.valueOf(9), person.getAddresses().getAddress().get(0).getPutCode());
    assertNotNull(person.getKeywords());
    assertNotNull(person.getKeywords().getKeywords());
    assertEquals(1, person.getKeywords().getKeywords().size());
    assertEquals(Long.valueOf(9), person.getKeywords().getKeywords().get(0).getPutCode());
    assertNotNull(person.getEmails());
    assertNotNull(person.getEmails().getEmails());
    assertEquals(1, person.getEmails().getEmails().size());
    assertEquals("public_0000-0000-0000-0003@test.orcid.org", person.getEmails().getEmails().get(0).getEmail());
    assertNotNull(person.getBiography());
    assertEquals(Visibility.PUBLIC, person.getBiography().getVisibility());
    assertEquals("Biography for 0000-0000-0000-0003", person.getBiography().getContent());
    assertNotNull(person.getName());
    assertNotNull(person.getName().getCreditName());
    assertEquals("Credit Name", person.getName().getCreditName().getContent());
    assertNotNull(person.getName().getFamilyName());
    assertEquals("Family Name", person.getName().getFamilyName().getContent());
    assertNotNull(person.getName().getGivenNames());
    assertEquals("Given Names", person.getName().getGivenNames().getContent());
    assertEquals(Visibility.PUBLIC, person.getName().getVisibility());
    ActivitiesSummary activities = record.getActivitiesSummary();
    assertNotNull(activities.getEducations());
    assertNotNull(activities.getEducations().getSummaries());
    assertEquals(1, activities.getEducations().getSummaries().size());
    assertEquals(Long.valueOf(20), activities.getEducations().getSummaries().get(0).getPutCode());
    assertNotNull(activities.getEmployments());
    assertNotNull(activities.getEmployments().getSummaries());
    assertEquals(1, activities.getEmployments().getSummaries().size());
    assertEquals(Long.valueOf(17), activities.getEmployments().getSummaries().get(0).getPutCode());
    assertNotNull(activities.getFundings());
    assertNotNull(activities.getFundings().getFundingGroup());
    assertEquals(1, activities.getFundings().getFundingGroup().size());
    assertEquals(Long.valueOf(10), activities.getFundings().getFundingGroup().get(0).getFundingSummary().get(0).getPutCode());
    assertNotNull(activities.getPeerReviews());
    assertNotNull(activities.getPeerReviews().getPeerReviewGroup());
    assertEquals(1, activities.getPeerReviews().getPeerReviewGroup().size());
    assertEquals(Long.valueOf(9), activities.getPeerReviews().getPeerReviewGroup().get(0).getPeerReviewSummary().get(0).getPutCode());
    assertNotNull(activities.getWorks());
    assertNotNull(activities.getWorks().getWorkGroup());
    assertEquals(1, activities.getWorks().getWorkGroup().size());
    assertEquals(Long.valueOf(11), activities.getWorks().getWorkGroup().get(0).getWorkSummary().get(0).getPutCode());
}
Also used : Record(org.orcid.jaxb.model.record_v2.Record) Person(org.orcid.jaxb.model.record_v2.Person) ActivitiesSummary(org.orcid.jaxb.model.record.summary_v2.ActivitiesSummary) Test(org.junit.Test) DBUnitTest(org.orcid.test.DBUnitTest)

Aggregations

Test (org.junit.Test)63 Person (org.orcid.jaxb.model.record_v2.Person)58 Email (org.orcid.jaxb.model.record_v2.Email)35 PersonExternalIdentifier (org.orcid.jaxb.model.record_v2.PersonExternalIdentifier)32 OtherName (org.orcid.jaxb.model.record_v2.OtherName)31 Address (org.orcid.jaxb.model.record_v2.Address)30 Emails (org.orcid.jaxb.model.record_v2.Emails)30 Keyword (org.orcid.jaxb.model.record_v2.Keyword)30 ResearcherUrl (org.orcid.jaxb.model.record_v2.ResearcherUrl)30 Name (org.orcid.jaxb.model.record_v2.Name)26 Addresses (org.orcid.jaxb.model.record_v2.Addresses)25 Biography (org.orcid.jaxb.model.record_v2.Biography)25 Keywords (org.orcid.jaxb.model.record_v2.Keywords)25 OtherNames (org.orcid.jaxb.model.record_v2.OtherNames)25 PersonExternalIdentifiers (org.orcid.jaxb.model.record_v2.PersonExternalIdentifiers)25 ResearcherUrls (org.orcid.jaxb.model.record_v2.ResearcherUrls)25 Record (org.orcid.jaxb.model.record_v2.Record)20 ActivitiesSummary (org.orcid.jaxb.model.record.summary_v2.ActivitiesSummary)19 EducationSummary (org.orcid.jaxb.model.record.summary_v2.EducationSummary)14 EmploymentSummary (org.orcid.jaxb.model.record.summary_v2.EmploymentSummary)14