Search in sources :

Example 81 with Name

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

the class OrcidSecurityManager_generalTest method testName_CanRead_When_HaveReadScope_IsLimited.

@Test
public void testName_CanRead_When_HaveReadScope_IsLimited() {
    SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.ORCID_BIO_READ_LIMITED);
    Name name = createName(Visibility.LIMITED);
    orcidSecurityManager.checkAndFilter(ORCID_1, name, ScopePathType.ORCID_BIO_READ_LIMITED);
}
Also used : OtherName(org.orcid.jaxb.model.v3.dev1.record.OtherName) Name(org.orcid.jaxb.model.v3.dev1.record.Name) Test(org.junit.Test)

Example 82 with Name

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

the class OrcidSecurityManager_generalTest method testName_CantRead_When_HaveReadScope_IsPrivate.

@Test(expected = OrcidVisibilityException.class)
public void testName_CantRead_When_HaveReadScope_IsPrivate() {
    SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.ORCID_BIO_READ_LIMITED);
    Name name = createName(Visibility.PRIVATE);
    orcidSecurityManager.checkAndFilter(ORCID_1, name, ScopePathType.ORCID_BIO_READ_LIMITED);
    fail();
}
Also used : OtherName(org.orcid.jaxb.model.v3.dev1.record.OtherName) Name(org.orcid.jaxb.model.v3.dev1.record.Name) Test(org.junit.Test)

Example 83 with Name

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

the class OrcidSecurityManager_generalTest method testName_CanRead_When_DontHaveReadScope_IsPublic.

@Test
public void testName_CanRead_When_DontHaveReadScope_IsPublic() {
    SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.ORCID_BIO_UPDATE);
    Name name = createName(Visibility.PUBLIC);
    orcidSecurityManager.checkAndFilter(ORCID_1, name, ScopePathType.ORCID_BIO_READ_LIMITED);
}
Also used : OtherName(org.orcid.jaxb.model.v3.dev1.record.OtherName) Name(org.orcid.jaxb.model.v3.dev1.record.Name) Test(org.junit.Test)

Example 84 with Name

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

the class OrcidSecurityManager_generalTest method testName_CanRead_When_ReadPublicToken_IsPublic.

/**
 * =================== checkAndFilter test's ===================
 */
// ---- ELEMENTS WITHOUT SOURCE ----
// Name element tests
@Test
public void testName_CanRead_When_ReadPublicToken_IsPublic() {
    SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.READ_PUBLIC);
    Name name = createName(Visibility.PUBLIC);
    orcidSecurityManager.checkAndFilter(ORCID_1, name, ScopePathType.ORCID_BIO_READ_LIMITED);
}
Also used : OtherName(org.orcid.jaxb.model.v3.dev1.record.OtherName) Name(org.orcid.jaxb.model.v3.dev1.record.Name) Test(org.junit.Test)

Example 85 with Name

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

the class OrcidSecurityManager_generalTest method testName_CantRead_When_DontHaveReadScope_IsLimited.

@Test(expected = OrcidAccessControlException.class)
public void testName_CantRead_When_DontHaveReadScope_IsLimited() {
    SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.ORCID_BIO_UPDATE);
    Name name = createName(Visibility.LIMITED);
    orcidSecurityManager.checkAndFilter(ORCID_1, name, ScopePathType.ORCID_BIO_READ_LIMITED);
    fail();
}
Also used : OtherName(org.orcid.jaxb.model.v3.dev1.record.OtherName) Name(org.orcid.jaxb.model.v3.dev1.record.Name) Test(org.junit.Test)

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