use of org.orcid.jaxb.model.record_rc4.Work 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.jaxb.model.record_rc4.Work in project ORCID-Source by ORCID.
the class BibtexManagerTest method testDOIManagerIsInvoked.
@Test
public void testDOIManagerIsInvoked() {
when(doiManager.fetchDOIBibtex("111")).thenReturn("OK");
Work w = new Work();
w.setWorkExternalIdentifiers(new ExternalIDs());
ExternalID id = new ExternalID();
id.setType("doi");
id.setValue("111");
w.getExternalIdentifiers().getExternalIdentifier().add(id);
String bib = bibtexManager.generateBibtex(ORCID, w);
Assert.assertEquals("OK", bib);
}
use of org.orcid.jaxb.model.record_rc4.Work in project ORCID-Source by ORCID.
the class BibtexManagerTest method testGenerateBibtexForSingleWorkEsaped.
@Test
public void testGenerateBibtexForSingleWorkEsaped() {
Work w = new Work();
WorkTitle title = new WorkTitle();
title.setTitle(new Title("Escapes θ à À È © ë Ö ì"));
w.setWorkTitle(title);
w.setWorkType(WorkType.JOURNAL_ARTICLE);
w.setPutCode(100l);
String bib = bibtexManager.generateBibtex(ORCID, w);
Assert.assertEquals("@article{Credit_Name100,\ntitle={Escapes \\texttheta {\\`a} \\`{A} \\`{E} \\textcopyright {\\\"e} {\\\"O} {\\`i}},\nauthor={Credit Name}\n}", bib);
}
use of org.orcid.jaxb.model.record_rc4.Work in project ORCID-Source by ORCID.
the class BibtexManagerTest method testGenerateBibtexForSingleWorkFromCitationField.
@Test
public void testGenerateBibtexForSingleWorkFromCitationField() {
Work w = new Work();
Citation c = new Citation();
c.setWorkCitationType(CitationType.BIBTEX);
c.setCitation("HELLO");
w.setWorkCitation(c);
String bib = bibtexManager.generateBibtex(ORCID, w);
Assert.assertEquals("HELLO", bib);
}
use of org.orcid.jaxb.model.record_rc4.Work in project ORCID-Source by ORCID.
the class WorkManagerTest method testFindWorkBulk.
@Test
public void testFindWorkBulk() {
String putCodes = "11,12,13";
WorkBulk workBulk = workManager.findWorkBulk("0000-0000-0000-0003", putCodes, System.currentTimeMillis());
assertNotNull(workBulk);
assertNotNull(workBulk.getBulk());
assertEquals(3, workBulk.getBulk().size());
assertTrue(workBulk.getBulk().get(0) instanceof Work);
assertTrue(workBulk.getBulk().get(1) instanceof Work);
assertTrue(workBulk.getBulk().get(2) instanceof Work);
}
Aggregations