Search in sources :

Example 31 with Biography

use of org.orcid.jaxb.model.v3.dev1.record.Biography in project ORCID-Source by ORCID.

the class OrcidSecurityManager_generalTest method testBio_CanRead_When_HaveReadScope_IsLimited.

@Test
public void testBio_CanRead_When_HaveReadScope_IsLimited() {
    SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.ORCID_BIO_READ_LIMITED);
    Biography bio = createBiography(Visibility.LIMITED);
    orcidSecurityManager.checkAndFilter(ORCID_1, bio, ScopePathType.ORCID_BIO_READ_LIMITED);
}
Also used : Biography(org.orcid.jaxb.model.v3.dev1.record.Biography) Test(org.junit.Test)

Example 32 with Biography

use of org.orcid.jaxb.model.v3.dev1.record.Biography in project ORCID-Source by ORCID.

the class PersonDetailsManagerTest method testGetPersonDetails.

@Test
public void testGetPersonDetails() {
    Person person = personDetailsManager.getPersonDetails(ORCID);
    assertNotNull(person);
    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());
}
Also used : Person(org.orcid.jaxb.model.v3.dev1.record.Person) Test(org.junit.Test) DBUnitTest(org.orcid.test.DBUnitTest)

Example 33 with Biography

use of org.orcid.jaxb.model.v3.dev1.record.Biography 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.v3.dev1.record.Person) Test(org.junit.Test) DBUnitTest(org.orcid.test.DBUnitTest)

Example 34 with Biography

use of org.orcid.jaxb.model.v3.dev1.record.Biography in project ORCID-Source by ORCID.

the class PersonalDetailsManagerTest method getPersonalDetailsTest2.

@Test
public void getPersonalDetailsTest2() {
    PersonalDetails personalDetails = personalDetailsManager.getPersonalDetails(ORCID2);
    assertNotNull(personalDetails);
    assertNotNull(personalDetails.getOtherNames());
    assertTrue(personalDetails.getOtherNames().getOtherNames().isEmpty());
    assertNotNull(personalDetails.getBiography());
    assertEquals(Visibility.LIMITED, personalDetails.getBiography().getVisibility());
    assertEquals("Biography for 0000-0000-0000-0002", personalDetails.getBiography().getContent());
    assertNotNull(personalDetails.getName());
    assertEquals("Credit Name", personalDetails.getName().getCreditName().getContent());
    assertEquals("Family Name", personalDetails.getName().getFamilyName().getContent());
    assertEquals("Given Names", personalDetails.getName().getGivenNames().getContent());
    assertEquals(Visibility.LIMITED, personalDetails.getName().getVisibility());
}
Also used : PersonalDetails(org.orcid.jaxb.model.v3.dev1.record.PersonalDetails) Test(org.junit.Test) BaseTest(org.orcid.core.BaseTest)

Example 35 with Biography

use of org.orcid.jaxb.model.v3.dev1.record.Biography 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.v3.dev1.record.Record) Person(org.orcid.jaxb.model.v3.dev1.record.Person) ActivitiesSummary(org.orcid.jaxb.model.v3.dev1.record.summary.ActivitiesSummary) Test(org.junit.Test) DBUnitTest(org.orcid.test.DBUnitTest)

Aggregations

Biography (org.orcid.jaxb.model.v3.dev1.record.Biography)76 Test (org.junit.Test)75 OtherName (org.orcid.jaxb.model.v3.dev1.record.OtherName)53 Name (org.orcid.jaxb.model.v3.dev1.record.Name)44 OtherNames (org.orcid.jaxb.model.v3.dev1.record.OtherNames)44 Address (org.orcid.jaxb.model.v3.dev1.record.Address)36 ResearcherUrl (org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl)36 Email (org.orcid.jaxb.model.v3.dev1.record.Email)35 Keyword (org.orcid.jaxb.model.v3.dev1.record.Keyword)35 Person (org.orcid.jaxb.model.v3.dev1.record.Person)35 PersonExternalIdentifier (org.orcid.jaxb.model.v3.dev1.record.PersonExternalIdentifier)35 ResearcherUrls (org.orcid.jaxb.model.v3.dev1.record.ResearcherUrls)32 Addresses (org.orcid.jaxb.model.v3.dev1.record.Addresses)31 Keywords (org.orcid.jaxb.model.v3.dev1.record.Keywords)31 PersonExternalIdentifiers (org.orcid.jaxb.model.v3.dev1.record.PersonExternalIdentifiers)31 Emails (org.orcid.jaxb.model.v3.dev1.record.Emails)29 PersonalDetails (org.orcid.jaxb.model.v3.dev1.record.PersonalDetails)22 Record (org.orcid.jaxb.model.v3.dev1.record.Record)18 ActivitiesSummary (org.orcid.jaxb.model.v3.dev1.record.summary.ActivitiesSummary)17 EducationSummary (org.orcid.jaxb.model.v3.dev1.record.summary.EducationSummary)15