use of org.orcid.jaxb.model.common_v2.Contributor in project ORCID-Source by ORCID.
the class ContributorUtilsTest method testFilterContributorPrivateDataForWorkWithInvalidOrcidRecord.
@Test
public void testFilterContributorPrivateDataForWorkWithInvalidOrcidRecord() {
when(profileEntityManager.orcidExists(anyString())).thenReturn(false);
Work work = getWorkWithOrcidContributor();
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.common_v2.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.common_v2.Contributor in project ORCID-Source by ORCID.
the class ContributorUtilsTest method getWorkContributorWithoutOrcid.
private WorkContributors getWorkContributorWithoutOrcid() {
Contributor contributor = new Contributor();
contributor.setContributorEmail(new ContributorEmail("never@show.this"));
contributor.setCreditName(new CreditName("original credit name"));
return new WorkContributors(Arrays.asList(contributor));
}
use of org.orcid.jaxb.model.common_v2.Contributor in project ORCID-Source by ORCID.
the class ContributorUtilsTest method testFilterContributorPrivateDataForWorkWithPublicName.
@Test
public void testFilterContributorPrivateDataForWorkWithPublicName() {
when(profileEntityManager.orcidExists(anyString())).thenReturn(true);
when(profileEntityCacheManager.retrieve(anyString())).thenReturn(new ProfileEntity());
when(cacheManager.getPublicCreditName(any(ProfileEntity.class))).thenReturn("a public name");
Work work = getWorkWithOrcidContributor();
contributorUtils.filterContributorPrivateData(work);
Contributor contributor = work.getWorkContributors().getContributor().get(0);
assertNull(contributor.getContributorEmail());
assertEquals("a public name", contributor.getCreditName().getContent());
}
use of org.orcid.jaxb.model.common_v2.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