use of org.orcid.jaxb.model.record_rc1.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_rc1.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_rc1.Funding in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateFunding_validFundingTest.
/**
* VALIDATE FUNDING
* */
@Test
public void validateFunding_validFundingTest() {
Funding funding = getFunding();
activityValidator.validateFunding(funding, null, true, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.record_rc1.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_rc1.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