use of org.orcid.jaxb.model.record_rc2.ResearcherUrls in project ORCID-Source by ORCID.
the class ValidateV2_1SamplesTest method testUnmarshallResearcherUrl.
@Test
public void testUnmarshallResearcherUrl() throws SAXException, URISyntaxException {
ResearcherUrls rUrls = (ResearcherUrls) unmarshallFromPath("/record_2.1/samples/read_samples/researcher-urls-2.1.xml", ResearcherUrls.class, "/record_2.1/researcher-url-2.1.xsd");
assertNotNull(rUrls);
assertNotNull(rUrls.getResearcherUrls());
assertEquals(1, rUrls.getResearcherUrls().size());
assertNotNull(rUrls.getResearcherUrls().get(0).getCreatedDate());
assertNotNull(rUrls.getResearcherUrls().get(0).getLastModifiedDate());
validateSourceInHttps(rUrls.getResearcherUrls().get(0).getSource());
assertEquals("Site # 1", rUrls.getResearcherUrls().get(0).getUrlName());
assertEquals("http://site1.com/", rUrls.getResearcherUrls().get(0).getUrl().getValue());
assertEquals(Long.valueOf(1248), rUrls.getResearcherUrls().get(0).getPutCode());
assertEquals(Visibility.PUBLIC.value(), rUrls.getResearcherUrls().get(0).getVisibility().value());
assertNotNull(rUrls.getResearcherUrls().get(0).getSource());
assertEquals("https://www.orcid.org/8888-8888-8888-8880", rUrls.getResearcherUrls().get(0).getSource().retriveSourceUri());
assertEquals("8888-8888-8888-8880", rUrls.getResearcherUrls().get(0).getSource().retrieveSourcePath());
ResearcherUrl rUrl = (ResearcherUrl) unmarshallFromPath("/record_2.1/samples/read_samples/researcher-url-2.1.xml", ResearcherUrl.class);
assertNotNull(rUrl);
assertEquals("Site # 1", rUrl.getUrlName());
assertNotNull(rUrl.getUrl());
assertEquals("http://site1.com/", rUrl.getUrl().getValue());
assertNotNull(rUrl.getCreatedDate());
assertNotNull(rUrl.getLastModifiedDate());
assertNotNull(rUrl.getSource());
validateSourceInHttps(rUrl.getSource());
assertEquals("8888-8888-8888-8880", rUrl.getSource().retrieveSourcePath());
}
use of org.orcid.jaxb.model.record_rc2.ResearcherUrls in project ORCID-Source by ORCID.
the class ValidateV2_1SamplesTest method testMarshallResearcherUrl.
@Test
public void testMarshallResearcherUrl() throws JAXBException, SAXException, URISyntaxException {
ResearcherUrls object = (ResearcherUrls) unmarshallFromPath("/record_2.1/samples/read_samples/researcher-urls-2.1.xml", ResearcherUrls.class);
marshall(object, "/record_2.1/researcher-url-2.1.xsd");
}
use of org.orcid.jaxb.model.record_rc2.ResearcherUrls in project ORCID-Source by ORCID.
the class PublicV2ApiServiceDelegatorTest method testViewResearcherUrls.
@Test
public void testViewResearcherUrls() {
Response response = serviceDelegator.viewResearcherUrls(ORCID);
assertNotNull(response);
ResearcherUrls rUrls = (ResearcherUrls) response.getEntity();
assertNotNull(rUrls);
assertNotNull(rUrls.getLastModifiedDate());
assertNotNull(rUrls.getLastModifiedDate().getValue());
assertEquals("/0000-0000-0000-0003/researcher-urls", rUrls.getPath());
assertEquals(1, rUrls.getResearcherUrls().size());
ResearcherUrl rUrl = rUrls.getResearcherUrls().get(0);
assertNotNull(rUrl);
assertNotNull(rUrl.getLastModifiedDate());
assertNotNull(rUrl.getLastModifiedDate().getValue());
assertNotNull(rUrl.getUrl());
assertEquals("http://www.researcherurl.com?id=13", rUrl.getUrl().getValue());
assertEquals("public_rurl", rUrl.getUrlName());
assertEquals(Visibility.PUBLIC.value(), rUrl.getVisibility().value());
assertEquals("/0000-0000-0000-0003/researcher-urls/13", rUrl.getPath());
assertEquals("APP-5555555555555555", rUrl.getSource().retrieveSourcePath());
}
use of org.orcid.jaxb.model.record_rc2.ResearcherUrls in project ORCID-Source by ORCID.
the class JpaJaxbResearcherUrlAdapterTest method getResearcherUrls.
private ResearcherUrls getResearcherUrls() throws JAXBException {
JAXBContext context = JAXBContext.newInstance(new Class[] { ResearcherUrls.class });
Unmarshaller unmarshaller = context.createUnmarshaller();
String name = "/record_2.0/samples/read_samples/researcher-urls-2.0.xml";
InputStream inputStream = getClass().getResourceAsStream(name);
return (ResearcherUrls) unmarshaller.unmarshal(inputStream);
}
use of org.orcid.jaxb.model.record_rc2.ResearcherUrls in project ORCID-Source by ORCID.
the class ResearcherUrlManagerTest method getPublicTest.
@Test
public void getPublicTest() {
String orcid = "0000-0000-0000-0003";
ResearcherUrls elements = researcherUrlManager.getPublicResearcherUrls(orcid, System.currentTimeMillis());
assertNotNull(elements);
assertNotNull(elements.getResearcherUrls());
assertEquals(1, elements.getResearcherUrls().size());
assertEquals(Long.valueOf(13), elements.getResearcherUrls().get(0).getPutCode());
}
Aggregations