use of org.orcid.jaxb.model.v3.dev1.record.Funding in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateFunding_invalidTranslatedTitleLanguageCodeTest.
@Test(expected = ActivityTypeValidationException.class)
public void validateFunding_invalidTranslatedTitleLanguageCodeTest() {
Funding funding = getFunding();
funding.getTitle().getTranslatedTitle().setLanguageCode("xx");
activityValidator.validateFunding(funding, null, true, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.v3.dev1.record.Funding in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateFundingWithoutOrg.
@Test(expected = InvalidOrgException.class)
public void validateFundingWithoutOrg() {
Funding f = getFunding();
f.setOrganization(null);
activityValidator.validateFunding(f, null, false, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.v3.dev1.record.Funding in project ORCID-Source by ORCID.
the class ProfileFundingManagerTest method testAddFundingToUnclaimedRecordPreserveFundingVisibility.
@Test
public void testAddFundingToUnclaimedRecordPreserveFundingVisibility() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
Funding funding = getFunding(null);
funding = profileFundingManager.createFunding(unclaimedOrcid, funding, true);
funding = profileFundingManager.getFunding(unclaimedOrcid, funding.getPutCode());
assertNotNull(funding);
assertEquals("Funding title", funding.getTitle().getTitle().getContent());
assertEquals(Visibility.PUBLIC, funding.getVisibility());
}
use of org.orcid.jaxb.model.v3.dev1.record.Funding in project ORCID-Source by ORCID.
the class ProfileFundingManagerTest method displayIndexIsSetTo_0_FromAPI.
@Test
public void displayIndexIsSetTo_0_FromAPI() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
Funding f1 = getFunding("fromAPI-1");
f1 = profileFundingManager.createFunding(claimedOrcid, f1, true);
ProfileFundingEntity f = profileFundingDao.find(f1.getPutCode());
assertNotNull(f);
assertEquals(Long.valueOf(0), f.getDisplayIndex());
}
use of org.orcid.jaxb.model.v3.dev1.record.Funding in project ORCID-Source by ORCID.
the class ProfileFundingManagerTest method testAddFundingToClaimedRecordPreserveUserDefaultVisibility.
@Test
public void testAddFundingToClaimedRecordPreserveUserDefaultVisibility() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
Funding funding = getFunding(null);
funding = profileFundingManager.createFunding(claimedOrcid, funding, true);
funding = profileFundingManager.getFunding(claimedOrcid, funding.getPutCode());
assertNotNull(funding);
assertEquals("Funding title", funding.getTitle().getTitle().getContent());
assertEquals(Visibility.LIMITED, funding.getVisibility());
}
Aggregations