use of org.orcid.persistence.jpa.entities.SourceEntity in project ORCID-Source by ORCID.
the class WorkManagerTest method displayIndexIsSetTo_0_FromAPI.
@Test
public void displayIndexIsSetTo_0_FromAPI() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
Work w1 = getWork("fromAPI-1");
w1 = workManager.createWork(claimedOrcid, w1, true);
WorkEntity w = workDao.find(w1.getPutCode());
assertNotNull(w1);
assertEquals(Long.valueOf(0), w.getDisplayIndex());
}
use of org.orcid.persistence.jpa.entities.SourceEntity in project ORCID-Source by ORCID.
the class WorkManagerTest method testAddWorkToUnclaimedRecordPreserveWorkVisibility.
@Test
public void testAddWorkToUnclaimedRecordPreserveWorkVisibility() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
Work work = getWork(null);
work = workManager.createWork(unclaimedOrcid, work, true);
work = workManager.getWork(unclaimedOrcid, work.getPutCode(), 0);
assertNotNull(work);
assertEquals("Work title", work.getWorkTitle().getTitle().getContent());
assertEquals(Visibility.PUBLIC, work.getVisibility());
}
use of org.orcid.persistence.jpa.entities.SourceEntity in project ORCID-Source by ORCID.
the class ResearcherUrlManagerTest method displayIndexIsSetTo_0_FromAPI.
@Test
public void displayIndexIsSetTo_0_FromAPI() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
ResearcherUrl rUrl = getResearcherUrl();
rUrl.getUrl().setValue(rUrl.getUrl().getValue() + "/fromAPI");
rUrl = researcherUrlManager.createResearcherUrl(claimedOrcid, rUrl, true);
rUrl = researcherUrlManager.getResearcherUrl(claimedOrcid, rUrl.getPutCode());
assertNotNull(rUrl);
assertEquals(Long.valueOf(0), rUrl.getDisplayIndex());
}
use of org.orcid.persistence.jpa.entities.SourceEntity in project ORCID-Source by ORCID.
the class ResearcherUrlManagerTest method displayIndexIsSetTo_1_FromUI.
@Test
public void displayIndexIsSetTo_1_FromUI() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
ResearcherUrl rUrl = getResearcherUrl();
rUrl.getUrl().setValue(rUrl.getUrl().getValue() + "/fromUI");
rUrl = researcherUrlManager.createResearcherUrl(claimedOrcid, rUrl, false);
rUrl = researcherUrlManager.getResearcherUrl(claimedOrcid, rUrl.getPutCode());
assertNotNull(rUrl);
assertEquals(Long.valueOf(1), rUrl.getDisplayIndex());
}
use of org.orcid.persistence.jpa.entities.SourceEntity in project ORCID-Source by ORCID.
the class ResearcherUrlManagerTest method testAddResearcherUrToClaimedRecordPreserveUserDefaultVisibility.
@Test
public void testAddResearcherUrToClaimedRecordPreserveUserDefaultVisibility() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
ResearcherUrl rUrl = getResearcherUrl();
rUrl = researcherUrlManager.createResearcherUrl(claimedOrcid, rUrl, true);
rUrl = researcherUrlManager.getResearcherUrl(claimedOrcid, rUrl.getPutCode());
assertNotNull(rUrl);
assertEquals(Visibility.LIMITED, rUrl.getVisibility());
}
Aggregations