use of org.orcid.jaxb.model.v3.dev1.record.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.v3.dev1.record.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.v3.dev1.record.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.v3.dev1.record.Work in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateWork_emptyContributorEmailTest.
@Test(expected = OrcidValidationException.class)
public void validateWork_emptyContributorEmailTest() {
Work work = getWork();
work.getWorkContributors().getContributor().get(0).getContributorEmail().setValue("");
activityValidator.validateWork(work, null, true, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.v3.dev1.record.Work in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateWork_emptyCitationTest.
@Test(expected = OrcidValidationException.class)
public void validateWork_emptyCitationTest() {
Work work = getWork();
work.getWorkCitation().setCitation(null);
activityValidator.validateWork(work, null, true, true, Visibility.PUBLIC);
}
Aggregations