use of org.orcid.jaxb.model.message.OrcidMessage in project ORCID-Source by ORCID.
the class Api12PublicTest method testViewBioDetailsJson.
@Test
public void testViewBioDetailsJson() throws Exception {
ClientResponse clientResponse = t1OAuthClient.viewBioDetailsJson(getUser1OrcidId());
assertNotNull(clientResponse);
assertEquals(200, clientResponse.getStatus());
OrcidMessage orcidMessage = clientResponse.getEntity(OrcidMessage.class);
assertNotNull(orcidMessage);
assertEquals(getUser1OrcidId(), orcidMessage.getOrcidProfile().getOrcidIdentifier().getPath());
}
use of org.orcid.jaxb.model.message.OrcidMessage in project ORCID-Source by ORCID.
the class Api12PublicTest method testViewFullDetailsXml.
@Test
public void testViewFullDetailsXml() throws Exception {
ClientResponse clientResponse = t1OAuthClient.viewFullDetailsXml(getUser1OrcidId());
assertNotNull(clientResponse);
assertEquals(200, clientResponse.getStatus());
OrcidMessage orcidMessage = clientResponse.getEntity(OrcidMessage.class);
assertNotNull(orcidMessage);
assertEquals(getUser1OrcidId(), orcidMessage.getOrcidProfile().getOrcidIdentifier().getPath());
}
use of org.orcid.jaxb.model.message.OrcidMessage in project ORCID-Source by ORCID.
the class MarshallingTest method getOrcidMessage.
private OrcidMessage getOrcidMessage() throws JAXBException {
JAXBContext context = JAXBContext.newInstance("org.orcid.jaxb.model.message");
Unmarshaller unmarshaller = context.createUnmarshaller();
InputStream inputStream = MarshallingTest.class.getResourceAsStream("/orcid-internal-full-message-latest.xml");
return (OrcidMessage) unmarshaller.unmarshal(inputStream);
}
use of org.orcid.jaxb.model.message.OrcidMessage in project ORCID-Source by ORCID.
the class T1OrcidApiServiceImplLatestMetricsTest method orcidWithMultipleResults.
private Response orcidWithMultipleResults() {
OrcidMessage orcidMessage = new OrcidMessage();
OrcidProfile orcidProfile1 = new OrcidProfile();
OrcidProfile orcidProfile2 = new OrcidProfile();
OrcidProfile orcidProfile3 = new OrcidProfile();
OrcidSearchResult orcidSearchResult1 = new OrcidSearchResult();
OrcidSearchResult orcidSearchResult2 = new OrcidSearchResult();
OrcidSearchResult orcidSearchResult3 = new OrcidSearchResult();
orcidSearchResult1.setOrcidProfile(orcidProfile1);
orcidSearchResult2.setOrcidProfile(orcidProfile2);
orcidSearchResult3.setOrcidProfile(orcidProfile3);
List<OrcidSearchResult> searchResults = new ArrayList<OrcidSearchResult>();
searchResults.add(orcidSearchResult1);
searchResults.add(orcidSearchResult2);
searchResults.add(orcidSearchResult3);
OrcidSearchResults orcidSearchResults = new OrcidSearchResults();
orcidSearchResults.getOrcidSearchResult().addAll(searchResults);
orcidMessage.setOrcidSearchResults(orcidSearchResults);
return Response.ok(orcidMessage).build();
}
use of org.orcid.jaxb.model.message.OrcidMessage in project ORCID-Source by ORCID.
the class NotificationManagerTest method testSendVerificationEmail.
@Test
public void testSendVerificationEmail() throws JAXBException, IOException, URISyntaxException {
OrcidMessage orcidMessage = (OrcidMessage) unmarshaller.unmarshal(getClass().getResourceAsStream(ORCID_INTERNAL_FULL_XML));
OrcidProfile orcidProfile = orcidMessage.getOrcidProfile();
notificationManager.sendVerificationEmail(orcidProfile.getOrcidIdentifier().getPath(), orcidProfile.getOrcidBio().getContactDetails().retrievePrimaryEmail().getValue());
}
Aggregations