Search in sources :

Example 81 with Name

use of org.openmuc.jasn1.compiler.pkix1explicit88.Name in project ORCID-Source by ORCID.

the class OrcidSecurityManager_generalTest method testPersonalDetails_When_AllPrivate_Source_ReadLimitedToken.

@Test
public void testPersonalDetails_When_AllPrivate_Source_ReadLimitedToken() {
    SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.ORCID_BIO_READ_LIMITED);
    Name name = createName(Visibility.PRIVATE);
    Biography bio = createBiography(Visibility.PRIVATE);
    OtherName o1 = createOtherName(Visibility.PRIVATE, CLIENT_1);
    OtherName o2 = createOtherName(Visibility.PRIVATE, CLIENT_1);
    OtherName o3 = createOtherName(Visibility.PRIVATE, CLIENT_1);
    OtherNames otherNames = new OtherNames();
    otherNames.setOtherNames(new ArrayList<OtherName>(Arrays.asList(o1, o2, o3)));
    PersonalDetails p = new PersonalDetails();
    p.setBiography(bio);
    p.setName(name);
    p.setOtherNames(otherNames);
    orcidSecurityManager.checkAndFilter(ORCID_1, p);
    assertNotNull(p);
    assertNull(p.getName());
    assertNull(p.getBiography());
    assertNotNull(p.getOtherNames());
    assertNotNull(p.getOtherNames().getOtherNames());
    assertEquals(3, p.getOtherNames().getOtherNames().size());
    assertTrue(p.getOtherNames().getOtherNames().contains(o1));
    assertTrue(p.getOtherNames().getOtherNames().contains(o2));
    assertTrue(p.getOtherNames().getOtherNames().contains(o3));
}
Also used : OtherNames(org.orcid.jaxb.model.record_v2.OtherNames) Biography(org.orcid.jaxb.model.record_v2.Biography) OtherName(org.orcid.jaxb.model.record_v2.OtherName) PersonalDetails(org.orcid.jaxb.model.record_v2.PersonalDetails) OtherName(org.orcid.jaxb.model.record_v2.OtherName) Name(org.orcid.jaxb.model.record_v2.Name) Test(org.junit.Test)

Example 82 with Name

use of org.openmuc.jasn1.compiler.pkix1explicit88.Name in project ORCID-Source by ORCID.

the class ValidateV2RC3SamplesTest method testMarshallName.

@Test
public void testMarshallName() throws JAXBException, SAXException, URISyntaxException {
    Name object = (Name) unmarshallFromPath("/record_2.0_rc3/samples/name-2.0_rc3.xml", Name.class);
    marshall(object, "/record_2.0_rc3/personal-details-2.0_rc3.xsd");
}
Also used : OtherName(org.orcid.jaxb.model.record_rc3.OtherName) CreditName(org.orcid.jaxb.model.record_rc3.CreditName) Name(org.orcid.jaxb.model.record_rc3.Name) Test(org.junit.Test)

Example 83 with Name

use of org.openmuc.jasn1.compiler.pkix1explicit88.Name in project ORCID-Source by ORCID.

the class ValidateV2SamplesTest method testMarshallName.

@Test
public void testMarshallName() throws JAXBException, SAXException, URISyntaxException {
    Name object = (Name) unmarshallFromPath("/record_2.0/samples/read_samples/name-2.0.xml", Name.class);
    marshall(object, "/record_2.0/personal-details-2.0.xsd");
}
Also used : CreditName(org.orcid.jaxb.model.record_v2.CreditName) OtherName(org.orcid.jaxb.model.record_v2.OtherName) Name(org.orcid.jaxb.model.record_v2.Name) Test(org.junit.Test)

Example 84 with Name

use of org.openmuc.jasn1.compiler.pkix1explicit88.Name in project ORCID-Source by ORCID.

the class ValidateV2RC4SamplesTest method testMarshallName.

@Test
public void testMarshallName() throws JAXBException, SAXException, URISyntaxException {
    Name object = (Name) unmarshallFromPath("/record_2.0_rc4/samples/name-2.0_rc4.xml", Name.class);
    marshall(object, "/record_2.0_rc4/personal-details-2.0_rc4.xsd");
}
Also used : CreditName(org.orcid.jaxb.model.record_rc4.CreditName) OtherName(org.orcid.jaxb.model.record_rc4.OtherName) Name(org.orcid.jaxb.model.record_rc4.Name) Test(org.junit.Test)

Example 85 with Name

use of org.openmuc.jasn1.compiler.pkix1explicit88.Name in project ORCID-Source by ORCID.

the class PublicAPISecurityManagerV2Test method getPersonElement.

private Person getPersonElement() {
    Visibility[] vs = { Visibility.PUBLIC, Visibility.PUBLIC, Visibility.PUBLIC };
    Person p = new Person();
    p.setAddresses(getAddressesElement(vs));
    p.setEmails(getEmailsElement(vs));
    p.setExternalIdentifiers(getPersonExternalIdentifiersElement(vs));
    p.setKeywords(getKeywordsElement(vs));
    p.setOtherNames(getOtherNamesElement(vs));
    p.setResearcherUrls(getResearcherUrlsElement(vs));
    Name name = new Name();
    name.setVisibility(Visibility.PUBLIC);
    p.setName(name);
    Biography b = new Biography();
    b.setVisibility(Visibility.PUBLIC);
    b.setContent("Biography test");
    p.setBiography(b);
    return p;
}
Also used : Biography(org.orcid.jaxb.model.record_v2.Biography) Visibility(org.orcid.jaxb.model.common_v2.Visibility) Person(org.orcid.jaxb.model.record_v2.Person) OtherName(org.orcid.jaxb.model.record_v2.OtherName) Name(org.orcid.jaxb.model.record_v2.Name)

Aggregations

Test (org.junit.Test)78 Name (org.orcid.jaxb.model.record_v2.Name)74 OtherName (org.orcid.jaxb.model.record_v2.OtherName)62 Biography (org.orcid.jaxb.model.record_v2.Biography)46 OtherNames (org.orcid.jaxb.model.record_v2.OtherNames)41 Address (org.orcid.jaxb.model.record_v2.Address)31 Email (org.orcid.jaxb.model.record_v2.Email)30 ResearcherUrl (org.orcid.jaxb.model.record_v2.ResearcherUrl)30 Addresses (org.orcid.jaxb.model.record_v2.Addresses)29 Emails (org.orcid.jaxb.model.record_v2.Emails)29 Keyword (org.orcid.jaxb.model.record_v2.Keyword)29 PersonExternalIdentifier (org.orcid.jaxb.model.record_v2.PersonExternalIdentifier)29 ResearcherUrls (org.orcid.jaxb.model.record_v2.ResearcherUrls)29 Keywords (org.orcid.jaxb.model.record_v2.Keywords)28 Person (org.orcid.jaxb.model.record_v2.Person)28 PersonExternalIdentifiers (org.orcid.jaxb.model.record_v2.PersonExternalIdentifiers)28 Record (org.orcid.jaxb.model.record_v2.Record)19 WorkSummary (org.orcid.jaxb.model.record.summary_v2.WorkSummary)18 EducationSummary (org.orcid.jaxb.model.record.summary_v2.EducationSummary)17 EmploymentSummary (org.orcid.jaxb.model.record.summary_v2.EmploymentSummary)17