use of org.orcid.jaxb.model.v3.dev1.record.Name 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.Name 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.Name 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());
}
use of org.orcid.jaxb.model.v3.dev1.record.Name in project ORCID-Source by ORCID.
the class OrcidSecurityManagerTestBase method createName.
protected Name createName(Visibility v) {
Name name = new Name();
name.setVisibility(v);
name.setCreditName(new CreditName("Credit Name"));
name.setFamilyName(new FamilyName("Family Name"));
name.setGivenNames(new GivenNames("Given Names"));
return name;
}
use of org.orcid.jaxb.model.v3.dev1.record.Name in project ORCID-Source by ORCID.
the class ClientManagerReadOnlyTest method getClient.
private Client getClient(String randomString) {
Client client = new Client();
client.setAllowAutoDeprecate(true);
client.setPersistentTokensEnabled(true);
client.setClientType(ClientType.CREATOR);
client.setDescription("description " + randomString);
client.setGroupProfileId("group-profile-id " + randomString);
client.setId(randomString);
client.setName("client-name " + randomString);
client.setWebsite("client-website " + randomString);
client.setAuthenticationProviderId("authentication-provider-id " + randomString);
Set<ClientRedirectUri> clientRedirectUris = new HashSet<ClientRedirectUri>();
ClientRedirectUri rUri1 = new ClientRedirectUri();
Set<ScopePathType> scopes1 = new HashSet<ScopePathType>();
scopes1.add(ScopePathType.ACTIVITIES_READ_LIMITED);
rUri1.setPredefinedClientScopes(scopes1);
rUri1.setRedirectUri("redirect-uri-1 " + randomString);
rUri1.setRedirectUriType("type-1 " + randomString);
rUri1.setUriActType("uri-act-type-1 " + randomString);
rUri1.setUriGeoArea("uri-geo-area-1 " + randomString);
ClientRedirectUri rUri2 = new ClientRedirectUri();
Set<ScopePathType> scopes2 = new HashSet<ScopePathType>();
scopes2.add(ScopePathType.ACTIVITIES_UPDATE);
rUri2.setPredefinedClientScopes(scopes2);
rUri2.setRedirectUri("redirect-uri-2 " + randomString);
rUri2.setRedirectUriType("type-2 " + randomString);
rUri2.setUriActType("uri-act-type-2 " + randomString);
rUri2.setUriGeoArea("uri-geo-area-2 " + randomString);
ClientRedirectUri rUri3 = new ClientRedirectUri();
Set<ScopePathType> scopes3 = new HashSet<ScopePathType>();
scopes3.add(ScopePathType.AFFILIATIONS_CREATE);
rUri3.setPredefinedClientScopes(scopes3);
rUri3.setRedirectUri("redirect-uri-3 " + randomString);
rUri3.setRedirectUriType("type-3 " + randomString);
rUri3.setUriActType("uri-act-type-3 " + randomString);
rUri3.setUriGeoArea("uri-geo-area-3 " + randomString);
clientRedirectUris.add(rUri1);
clientRedirectUris.add(rUri2);
clientRedirectUris.add(rUri3);
client.setClientRedirectUris(clientRedirectUris);
return client;
}
Aggregations