use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class ActivityValidatorTest method getFunding.
public Funding getFunding() {
Funding funding = new Funding();
Amount amount = new Amount();
amount.setContent("1000");
amount.setCurrencyCode("$");
funding.setAmount(amount);
FundingContributor contributor = new FundingContributor();
FundingContributorAttributes attributes = new FundingContributorAttributes();
attributes.setContributorRole(FundingContributorRole.LEAD);
ContributorOrcid contributorOrcid = new ContributorOrcid();
contributorOrcid.setHost("http://test.orcid.org");
contributorOrcid.setPath("0000-0000-0000-0000");
contributorOrcid.setUri("http://test.orcid.org/0000-0000-0000-0000");
contributor.setContributorAttributes(attributes);
contributor.setContributorOrcid(contributorOrcid);
FundingContributors contributors = new FundingContributors();
contributors.getContributor().add(contributor);
funding.setContributors(contributors);
funding.setDescription("description");
funding.setEndDate(getFuzzyDate());
funding.setExternalIdentifiers(getExternalIDs());
funding.setOrganization(getOrganization());
funding.setOrganizationDefinedType(new OrganizationDefinedFundingSubType("subtype"));
funding.setStartDate(getFuzzyDate());
FundingTitle title = new FundingTitle();
title.setTitle(new Title("title"));
title.setTranslatedTitle(new TranslatedTitle("translated title", "en"));
funding.setTitle(title);
funding.setType(FundingType.AWARD);
funding.setUrl(new Url("http://test.orcid.org"));
funding.setVisibility(Visibility.PUBLIC);
return funding;
}
use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateFunding_emptyExternalIdentifiersTest.
@Test(expected = ActivityIdentifierValidationException.class)
public void validateFunding_emptyExternalIdentifiersTest() {
Funding funding = getFunding();
funding.getExternalIdentifiers().getExternalIdentifier().clear();
activityValidator.validateFunding(funding, null, true, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class ContributorUtilsTest method testFilterContributorPrivateDataForFundingWithNoOrcidRecord.
@Test
public void testFilterContributorPrivateDataForFundingWithNoOrcidRecord() {
Funding funding = getFundingWithContributorWithoutOrcid();
contributorUtils.filterContributorPrivateData(funding);
FundingContributor contributor = funding.getContributors().getContributor().get(0);
assertNull(contributor.getContributorEmail());
assertEquals("original credit name", contributor.getCreditName().getContent());
}
use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class ContributorUtilsTest method getFundingWithoutContributors.
private Funding getFundingWithoutContributors() {
Funding funding = new Funding();
FundingTitle fundingTitle = new FundingTitle();
fundingTitle.setTitle(new Title("funding without contributors"));
funding.setTitle(fundingTitle);
return funding;
}
use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class ContributorUtilsTest method testFilterContributorPrivateDataForFundingWithoutContributors.
@Test
public void testFilterContributorPrivateDataForFundingWithoutContributors() {
Funding funding = getFundingWithoutContributors();
contributorUtils.filterContributorPrivateData(funding);
// test no failures
assertNotNull(funding);
}
Aggregations