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