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);
}
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());
}
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());
}
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());
}
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());
}
Aggregations