use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class OrcidRecordToSolrDocumentTest method testOrgIDAndGrantNumber.
@Test
public void testOrgIDAndGrantNumber() throws JAXBException {
Record record = getRecord("/v20record.xml");
OrcidRecordToSolrDocument v20 = new OrcidRecordToSolrDocument(false);
OrcidSolrDocument v20Doc = v20.convert(record, new ArrayList<Funding>());
Assert.assertTrue(v20Doc.getOrganisationIds().containsKey("ringgold-org-id"));
Assert.assertTrue(v20Doc.getOrganisationIds().get("ringgold-org-id").contains("5488"));
Assert.assertTrue(v20Doc.getOrganisationIds().get("ringgold-org-id").contains("4925"));
Assert.assertTrue(v20Doc.getOrganisationNames().get("affiliation-org-name").contains("Open University"));
Assert.assertTrue(v20Doc.getOrganisationNames().get("affiliation-org-name").contains("British Library"));
/*
Assert.assertTrue(v20Doc.getOrganisationNames().get("funding-org-name").contains("THOR - Technical and Human Infrastructure for Open Research"));
Assert.assertTrue(v20Doc.getGrantNumbers().contains("H2020-EU.1.4.1.3."));
*/
}
use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class PublicV2ApiServiceDelegatorTest method testGetPublicFundingUsingToken.
// Funding
@Test
public void testGetPublicFundingUsingToken() {
SecurityContextTestUtils.setUpSecurityContext(ORCID, ScopePathType.READ_LIMITED);
Response r = serviceDelegator.viewFunding(ORCID, 10L);
assertNotNull(r);
Funding f = (Funding) r.getEntity();
assertNotNull(f);
assertNotNull(f.getLastModifiedDate());
assertNotNull(f.getLastModifiedDate().getValue());
assertEquals(Long.valueOf(10), f.getPutCode());
}
use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class SourceInActivitiesTest method getFundingWithPutCode.
private ProfileFundingEntity getFundingWithPutCode(String userOrcid) {
Funding funding = new Funding();
funding.setOrganization(getOrganization());
FundingTitle title = new FundingTitle();
title.setTitle(new Title("Title " + System.currentTimeMillis()));
funding.setTitle(title);
funding.setType(org.orcid.jaxb.model.record_v2.FundingType.AWARD);
ExternalID extId = new ExternalID();
extId.setValue("111");
extId.setType(FundingExternalIdentifierType.GRANT_NUMBER.value());
extId.setUrl(new Url("http://test.com"));
ExternalIDs extIdentifiers = new ExternalIDs();
extIdentifiers.getExternalIdentifier().add(extId);
funding.setExternalIdentifiers(extIdentifiers);
funding.setPutCode(Long.valueOf(111));
funding = profileFundingManager.createFunding(userOrcid, funding, true);
return profileFundingManager.getProfileFundingEntity(funding.getPutCode());
}
use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateFunding_dontChangeVisibilityTest.
@Test(expected = VisibilityMismatchException.class)
public void validateFunding_dontChangeVisibilityTest() {
Funding funding = getFunding();
funding.setVisibility(Visibility.LIMITED);
activityValidator.validateFunding(funding, null, false, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateFunding_emptyTitleTest.
@Test(expected = ActivityTitleValidationException.class)
public void validateFunding_emptyTitleTest() {
Funding funding = getFunding();
funding.getTitle().getTitle().setContent(null);
activityValidator.validateFunding(funding, null, true, true, Visibility.PUBLIC);
}
Aggregations