use of org.nextprot.api.core.domain.Publication in project nextprot-api by calipho-sib.
the class PublicationServiceTest method testFindPublicationById.
@Ignore
@Test
public void testFindPublicationById() {
Publication publication = this.publicationService.findPublicationById(100L);
assertEquals(100L, publication.getPublicationId());
assertEquals("an interesting paper", publication.getTitle());
}
use of org.nextprot.api.core.domain.Publication in project nextprot-api by calipho-sib.
the class PublicationServiceTest method verifyFindPublicationById.
@Test
public void verifyFindPublicationById() {
Publication publication = mock(Publication.class);
when(publication.getPublicationId()).thenReturn(1L);
when(publicationDao.findPublicationById(100L)).thenReturn(publication);
publicationService.findPublicationById(100L);
verify(publicationDao).findPublicationById(100L);
verify(authorService).findAuthorsByPublicationId(1L);
verify(dbXrefService).findDbXRefByPublicationId(1L);
}
use of org.nextprot.api.core.domain.Publication in project nextprot-api by calipho-sib.
the class ConsistencyResourceTest method shouldFindAllPublications.
@Test
public void shouldFindAllPublications() {
boolean missingPublications = false;
List<String> pubmedIds = statementDao.findAllDistinctValuesforFieldWhereFieldEqualsValues(StatementField.REFERENCE_ACCESSION, new StatementSimpleWhereClauseQueryDSL(StatementField.REFERENCE_DATABASE, "PubMed"));
System.out.println("Found " + pubmedIds.size() + " distinct pubmeds");
for (String p : pubmedIds) {
if (p != null) {
String pubmedId = p.replace("(PubMed,", "").replace(")", "");
Publication pub = publicationService.findPublicationByDatabaseAndAccession("PubMed", pubmedId);
// TODO: remove the following line after next release data jan 2018
if (!"23248292".equals(pubmedId)) {
if (pub == null) {
System.err.println("Can t find publication for " + pubmedId);
missingPublications = true;
}
} else {
System.err.println("FOUND EMPTY PUBLICATION " + pubmedId + ", FIX THIS IN NEXT RELEASE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Probably related to: https://issues.isb-sib.ch/browse/NEXTPROT-1369");
}
}
}
;
if (missingPublications)
Assert.fail();
}
use of org.nextprot.api.core.domain.Publication in project nextprot-api by calipho-sib.
the class PublicationServiceIntegrationTest method testPublicationXrefs.
@Test
@Ignore
public void testPublicationXrefs() {
Publication publication = publicationService.findPublicationById(690405);
// check that publication bug NEXTPROT-989 is fixed (pmid 12631268), should have 2 xrefs
List<PublicationDbXref> xrefs = publication.getDbXrefs();
// System.err.println(TerminologyUtils.convertXrefsToSolrString(new ArrayList<DbXref>(xrefs)));
Assert.assertTrue(xrefs.size() > 1);
}
use of org.nextprot.api.core.domain.Publication in project nextprot-api by calipho-sib.
the class PublicationServiceIntegrationTest method testPublicationPubmed23248292.
// TODO: do not ignore the following test after next release data jan 2018
@Ignore
@Test
public void testPublicationPubmed23248292() {
Publication publication = publicationService.findPublicationByDatabaseAndAccession("PubMed", "23248292");
Assert.assertEquals("Proteasome inhibition rescues clinically significant unstable variants of the mismatch repair protein Msh2.", publication.getTitle());
}
Aggregations