Search in sources :

Example 56 with Keywords

use of org.orcid.jaxb.model.record_v2.Keywords in project ORCID-Source by ORCID.

the class ValidateV2_1SamplesTest method testMarshallKeyword.

@Test
public void testMarshallKeyword() throws JAXBException, SAXException, URISyntaxException {
    Keywords object = (Keywords) unmarshallFromPath("/record_2.1/samples/read_samples/keywords-2.1.xml", Keywords.class);
    marshall(object, "/record_2.1/keyword-2.1.xsd");
}
Also used : Keywords(org.orcid.jaxb.model.record_v2.Keywords) Test(org.junit.Test)

Example 57 with Keywords

use of org.orcid.jaxb.model.record_v2.Keywords in project ORCID-Source by ORCID.

the class MemberV2ApiServiceDelegator_KeywordsTest method testViewLimitedKeyword.

@Test
public void testViewLimitedKeyword() {
    SecurityContextTestUtils.setUpSecurityContext("4444-4444-4444-4443", ScopePathType.PERSON_READ_LIMITED);
    Response response = serviceDelegator.viewKeyword("4444-4444-4444-4443", 2L);
    assertNotNull(response);
    Keyword keyword = (Keyword) response.getEntity();
    assertNotNull(keyword);
    assertEquals("/4444-4444-4444-4443/keywords/2", keyword.getPath());
    Utils.verifyLastModified(keyword.getLastModifiedDate());
    assertEquals("coffee making", keyword.getContent());
    assertEquals(Visibility.LIMITED, keyword.getVisibility());
    assertEquals("4444-4444-4444-4443", keyword.getSource().retrieveSourcePath());
}
Also used : Response(javax.ws.rs.core.Response) Keyword(org.orcid.jaxb.model.record_v2.Keyword) DBUnitTest(org.orcid.test.DBUnitTest) Test(org.junit.Test)

Example 58 with Keywords

use of org.orcid.jaxb.model.record_v2.Keywords in project ORCID-Source by ORCID.

the class MemberV2ApiServiceDelegator_KeywordsTest method testViewPublicKeyword.

@Test
public void testViewPublicKeyword() {
    SecurityContextTestUtils.setUpSecurityContext("4444-4444-4444-4443", ScopePathType.PERSON_READ_LIMITED);
    Response response = serviceDelegator.viewKeyword("4444-4444-4444-4443", 1L);
    assertNotNull(response);
    Keyword keyword = (Keyword) response.getEntity();
    assertNotNull(keyword);
    assertEquals("/4444-4444-4444-4443/keywords/1", keyword.getPath());
    Utils.verifyLastModified(keyword.getLastModifiedDate());
    assertEquals("tea making", keyword.getContent());
    assertEquals(Visibility.PUBLIC, keyword.getVisibility());
    assertEquals("APP-5555555555555555", keyword.getSource().retrieveSourcePath());
}
Also used : Response(javax.ws.rs.core.Response) Keyword(org.orcid.jaxb.model.record_v2.Keyword) DBUnitTest(org.orcid.test.DBUnitTest) Test(org.junit.Test)

Example 59 with Keywords

use of org.orcid.jaxb.model.record_v2.Keywords in project ORCID-Source by ORCID.

the class MemberV2ApiServiceDelegator_KeywordsTest method testViewPrivateKeyword.

@Test
public void testViewPrivateKeyword() {
    SecurityContextTestUtils.setUpSecurityContext("4444-4444-4444-4443", ScopePathType.PERSON_READ_LIMITED);
    Response response = serviceDelegator.viewKeyword("4444-4444-4444-4443", 4L);
    assertNotNull(response);
    Keyword keyword = (Keyword) response.getEntity();
    assertNotNull(keyword);
    assertEquals("/4444-4444-4444-4443/keywords/4", keyword.getPath());
    Utils.verifyLastModified(keyword.getLastModifiedDate());
    assertEquals("what else can we make?", keyword.getContent());
    assertEquals(Visibility.PRIVATE, keyword.getVisibility());
    assertEquals("APP-5555555555555555", keyword.getSource().retrieveSourcePath());
}
Also used : Response(javax.ws.rs.core.Response) Keyword(org.orcid.jaxb.model.record_v2.Keyword) DBUnitTest(org.orcid.test.DBUnitTest) Test(org.junit.Test)

Example 60 with Keywords

use of org.orcid.jaxb.model.record_v2.Keywords in project ORCID-Source by ORCID.

the class MemberV2ApiServiceDelegator_KeywordsTest method testViewKeywordReadPublic.

@Test
public void testViewKeywordReadPublic() {
    SecurityContextTestUtils.setUpSecurityContextForClientOnly("APP-5555555555555555", ScopePathType.READ_PUBLIC);
    Response r = serviceDelegator.viewKeyword(ORCID, 9L);
    Keyword element = (Keyword) r.getEntity();
    assertNotNull(element);
    assertEquals("/0000-0000-0000-0003/keywords/9", element.getPath());
    Utils.assertIsPublicOrSource(element, "APP-5555555555555555");
}
Also used : Response(javax.ws.rs.core.Response) Keyword(org.orcid.jaxb.model.record_v2.Keyword) DBUnitTest(org.orcid.test.DBUnitTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)62 Keywords (org.orcid.jaxb.model.record_v2.Keywords)54 Keyword (org.orcid.jaxb.model.record_v2.Keyword)53 OtherNames (org.orcid.jaxb.model.record_v2.OtherNames)37 Address (org.orcid.jaxb.model.record_v2.Address)36 Biography (org.orcid.jaxb.model.record_v2.Biography)36 PersonExternalIdentifier (org.orcid.jaxb.model.record_v2.PersonExternalIdentifier)36 Addresses (org.orcid.jaxb.model.record_v2.Addresses)35 Email (org.orcid.jaxb.model.record_v2.Email)35 PersonExternalIdentifiers (org.orcid.jaxb.model.record_v2.PersonExternalIdentifiers)35 ResearcherUrl (org.orcid.jaxb.model.record_v2.ResearcherUrl)35 ResearcherUrls (org.orcid.jaxb.model.record_v2.ResearcherUrls)35 OtherName (org.orcid.jaxb.model.record_v2.OtherName)34 Emails (org.orcid.jaxb.model.record_v2.Emails)33 Name (org.orcid.jaxb.model.record_v2.Name)30 Person (org.orcid.jaxb.model.record_v2.Person)28 EducationSummary (org.orcid.jaxb.model.record.summary_v2.EducationSummary)17 EmploymentSummary (org.orcid.jaxb.model.record.summary_v2.EmploymentSummary)17 WorkSummary (org.orcid.jaxb.model.record.summary_v2.WorkSummary)17 Record (org.orcid.jaxb.model.record_v2.Record)17