Search in sources :

Example 1 with OrganizationDefinedFundingSubType

use of org.orcid.jaxb.model.message.OrganizationDefinedFundingSubType in project ORCID-Source by ORCID.

the class T2OrcidApiServiceDelegatorTest method testAddFundingToDeprecatedAccount.

@Test(expected = OrcidDeprecatedException.class)
public void testAddFundingToDeprecatedAccount() {
    SecurityContextTestUtils.setUpSecurityContext();
    OrcidMessage orcidMessage = new OrcidMessage();
    orcidMessage.setMessageVersion("1.2_rc6");
    OrcidProfile orcidProfile = new OrcidProfile();
    orcidMessage.setOrcidProfile(orcidProfile);
    orcidProfile.setOrcidIdentifier(new OrcidIdentifier("4444-4444-4444-444X"));
    OrcidActivities orcidActivities = new OrcidActivities();
    orcidProfile.setOrcidActivities(orcidActivities);
    FundingList fundings = new FundingList();
    Funding funding = new Funding();
    OrganizationAddress address = new OrganizationAddress();
    address.setCity("City");
    address.setCountry(Iso3166Country.US);
    Organization org = new Organization();
    org.setAddress(address);
    org.setName("Testing org name");
    funding.setOrganization(org);
    FundingExternalIdentifiers fExtIds = new FundingExternalIdentifiers();
    FundingExternalIdentifier fExtId = new FundingExternalIdentifier();
    fExtId.setType(FundingExternalIdentifierType.GRANT_NUMBER);
    fExtId.setValue("FExtId");
    fExtIds.getFundingExternalIdentifier().add(fExtId);
    funding.setFundingExternalIdentifiers(fExtIds);
    funding.setType(FundingType.AWARD);
    funding.setOrganizationDefinedFundingType(new OrganizationDefinedFundingSubType("fType"));
    FundingTitle title = new FundingTitle();
    title.setTitle(new Title("Funding title"));
    funding.setTitle(title);
    fundings.getFundings().add(funding);
    orcidActivities.setFundings(fundings);
    t2OrcidApiServiceDelegator.addFunding(mockedUriInfo, "4444-4444-4444-444X", orcidMessage);
}
Also used : Organization(org.orcid.jaxb.model.message.Organization) Funding(org.orcid.jaxb.model.message.Funding) OrganizationAddress(org.orcid.jaxb.model.message.OrganizationAddress) Title(org.orcid.jaxb.model.message.Title) WorkTitle(org.orcid.jaxb.model.message.WorkTitle) FundingTitle(org.orcid.jaxb.model.message.FundingTitle) OrcidActivities(org.orcid.jaxb.model.message.OrcidActivities) FundingExternalIdentifier(org.orcid.jaxb.model.message.FundingExternalIdentifier) OrcidProfile(org.orcid.jaxb.model.message.OrcidProfile) FundingList(org.orcid.jaxb.model.message.FundingList) OrcidIdentifier(org.orcid.jaxb.model.message.OrcidIdentifier) OrcidMessage(org.orcid.jaxb.model.message.OrcidMessage) FundingTitle(org.orcid.jaxb.model.message.FundingTitle) FundingExternalIdentifiers(org.orcid.jaxb.model.message.FundingExternalIdentifiers) OrganizationDefinedFundingSubType(org.orcid.jaxb.model.message.OrganizationDefinedFundingSubType) DBUnitTest(org.orcid.test.DBUnitTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Funding (org.orcid.jaxb.model.message.Funding)1 FundingExternalIdentifier (org.orcid.jaxb.model.message.FundingExternalIdentifier)1 FundingExternalIdentifiers (org.orcid.jaxb.model.message.FundingExternalIdentifiers)1 FundingList (org.orcid.jaxb.model.message.FundingList)1 FundingTitle (org.orcid.jaxb.model.message.FundingTitle)1 OrcidActivities (org.orcid.jaxb.model.message.OrcidActivities)1 OrcidIdentifier (org.orcid.jaxb.model.message.OrcidIdentifier)1 OrcidMessage (org.orcid.jaxb.model.message.OrcidMessage)1 OrcidProfile (org.orcid.jaxb.model.message.OrcidProfile)1 Organization (org.orcid.jaxb.model.message.Organization)1 OrganizationAddress (org.orcid.jaxb.model.message.OrganizationAddress)1 OrganizationDefinedFundingSubType (org.orcid.jaxb.model.message.OrganizationDefinedFundingSubType)1 Title (org.orcid.jaxb.model.message.Title)1 WorkTitle (org.orcid.jaxb.model.message.WorkTitle)1 DBUnitTest (org.orcid.test.DBUnitTest)1