use of org.orcid.jaxb.model.v3.dev1.common.Contributor in project ORCID-Source by ORCID.
the class ContributorUtilsTest method getFundingContributorWithoutOrcid.
private FundingContributors getFundingContributorWithoutOrcid() {
FundingContributor contributor = new FundingContributor();
contributor.setContributorEmail(new ContributorEmail("never@show.this"));
contributor.setCreditName(new CreditName("original credit name"));
FundingContributors fundingContributors = new FundingContributors();
fundingContributors.getContributor().add(contributor);
return fundingContributors;
}
use of org.orcid.jaxb.model.v3.dev1.common.Contributor in project ORCID-Source by ORCID.
the class ContributorUtilsTest method testFilterContributorPrivateDataForWorkWithPrivateName.
@Test
public void testFilterContributorPrivateDataForWorkWithPrivateName() {
when(profileEntityManager.orcidExists(anyString())).thenReturn(true);
when(profileEntityCacheManager.retrieve(anyString())).thenReturn(new ProfileEntity());
when(cacheManager.getPublicCreditName(any(ProfileEntity.class))).thenReturn(null);
Work work = getWorkWithOrcidContributor();
contributorUtils.filterContributorPrivateData(work);
Contributor contributor = work.getWorkContributors().getContributor().get(0);
assertNull(contributor.getContributorEmail());
assertEquals("", contributor.getCreditName().getContent());
}
use of org.orcid.jaxb.model.v3.dev1.common.Contributor in project ORCID-Source by ORCID.
the class ContributorUtilsTest method testFilterContributorPrivateDataForFundingWithPrivateName.
@Test
public void testFilterContributorPrivateDataForFundingWithPrivateName() {
when(profileEntityManager.orcidExists(anyString())).thenReturn(true);
when(profileEntityCacheManager.retrieve(anyString())).thenReturn(new ProfileEntity());
when(cacheManager.getPublicCreditName(any(ProfileEntity.class))).thenReturn(null);
Funding funding = getFundingWithOrcidContributor();
contributorUtils.filterContributorPrivateData(funding);
FundingContributor contributor = funding.getContributors().getContributor().get(0);
assertNull(contributor.getContributorEmail());
assertEquals("", contributor.getCreditName().getContent());
}
use of org.orcid.jaxb.model.v3.dev1.common.Contributor in project ORCID-Source by ORCID.
the class ContributorUtilsTest method testFilterContributorPrivateDataForWorkWithNoOrcidRecord.
@Test
public void testFilterContributorPrivateDataForWorkWithNoOrcidRecord() {
Work work = getWorkWithContributorWithoutOrcid();
contributorUtils.filterContributorPrivateData(work);
Contributor contributor = work.getWorkContributors().getContributor().get(0);
assertNull(contributor.getContributorEmail());
assertEquals("original credit name", contributor.getCreditName().getContent());
}
use of org.orcid.jaxb.model.v3.dev1.common.Contributor in project ORCID-Source by ORCID.
the class ContributorUtilsTest method getWorkWithContributorWithoutOrcid.
private Work getWorkWithContributorWithoutOrcid() {
Work work = new Work();
WorkTitle workTitle = new WorkTitle();
workTitle.setTitle(new Title("work with contributor without ORCID record"));
work.setWorkTitle(workTitle);
work.setWorkContributors(getWorkContributorWithoutOrcid());
return work;
}
Aggregations