Search in sources :

Example 91 with Name

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());
}
Also used : Person(org.orcid.jaxb.model.v3.dev1.record.Person) Test(org.junit.Test) DBUnitTest(org.orcid.test.DBUnitTest)

Example 92 with Name

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());
}
Also used : PersonalDetails(org.orcid.jaxb.model.v3.dev1.record.PersonalDetails) Test(org.junit.Test) BaseTest(org.orcid.core.BaseTest)

Example 93 with Name

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

Example 94 with Name

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;
}
Also used : FamilyName(org.orcid.jaxb.model.v3.dev1.record.FamilyName) GivenNames(org.orcid.jaxb.model.v3.dev1.record.GivenNames) CreditName(org.orcid.jaxb.model.v3.dev1.common.CreditName) CreditName(org.orcid.jaxb.model.v3.dev1.common.CreditName) FamilyName(org.orcid.jaxb.model.v3.dev1.record.FamilyName) OtherName(org.orcid.jaxb.model.v3.dev1.record.OtherName) Name(org.orcid.jaxb.model.v3.dev1.record.Name)

Example 95 with 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;
}
Also used : ClientRedirectUri(org.orcid.jaxb.model.v3.dev1.client.ClientRedirectUri) ScopePathType(org.orcid.jaxb.model.message.ScopePathType) Client(org.orcid.jaxb.model.v3.dev1.client.Client) HashSet(java.util.HashSet)

Aggregations

Test (org.junit.Test)175 OtherName (org.orcid.jaxb.model.v3.dev1.record.OtherName)84 Name (org.orcid.jaxb.model.v3.dev1.record.Name)70 DBUnitTest (org.orcid.test.DBUnitTest)53 Biography (org.orcid.jaxb.model.v3.dev1.record.Biography)51 OtherNames (org.orcid.jaxb.model.v3.dev1.record.OtherNames)48 Response (javax.ws.rs.core.Response)43 PersonExternalIdentifier (org.orcid.jaxb.model.v3.dev1.record.PersonExternalIdentifier)43 ResearcherUrl (org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl)40 Email (org.orcid.jaxb.model.v3.dev1.record.Email)39 Address (org.orcid.jaxb.model.v3.dev1.record.Address)37 Keyword (org.orcid.jaxb.model.v3.dev1.record.Keyword)36 Person (org.orcid.jaxb.model.v3.dev1.record.Person)35 Addresses (org.orcid.jaxb.model.v3.dev1.record.Addresses)33 PersonExternalIdentifiers (org.orcid.jaxb.model.v3.dev1.record.PersonExternalIdentifiers)33 ResearcherUrls (org.orcid.jaxb.model.v3.dev1.record.ResearcherUrls)33 Keywords (org.orcid.jaxb.model.v3.dev1.record.Keywords)31 Emails (org.orcid.jaxb.model.v3.dev1.record.Emails)30 ClientResponse (com.sun.jersey.api.client.ClientResponse)25 ActivitiesSummary (org.orcid.jaxb.model.v3.dev1.record.summary.ActivitiesSummary)25