Search in sources :

Example 6 with Publication

use of org.nextprot.api.core.domain.Publication in project nextprot-api by calipho-sib.

the class PublicationServiceIntegrationTest method testPublicationAbstract.

@Test
public void testPublicationAbstract() {
    Publication publication = publicationService.findPublicationById(41589965);
    Assert.assertTrue(publication.getFirstPage().equals("254"));
    // check that abstract bug CALIPHOMISC-241 is fixed (pmid 24867236)
    Assert.assertTrue(publication.getAbstractText().length() > 0);
}
Also used : Publication(org.nextprot.api.core.domain.Publication) CoreUnitBaseTest(org.nextprot.api.core.test.base.CoreUnitBaseTest) Test(org.junit.Test)

Example 7 with Publication

use of org.nextprot.api.core.domain.Publication in project nextprot-api by calipho-sib.

the class PublicationServiceIntegrationTest method testPublicationAbstractAsItShouldBeIfLoadedCorrectly.

@Test
@Ignore
public void testPublicationAbstractAsItShouldBeIfLoadedCorrectly() {
    Publication publication = publicationService.findPublicationById(41589965);
    Assert.assertTrue(publication.getFirstPage().equals("254"));
    // check that abstract bug CALIPHOMISC-241 is fixed (pmid 24867236)
    System.err.println(publication.getAbstractText());
    Assert.assertTrue(publication.getAbstractText().contains("regulator of microtubule organisation"));
}
Also used : Publication(org.nextprot.api.core.domain.Publication) Ignore(org.junit.Ignore) CoreUnitBaseTest(org.nextprot.api.core.test.base.CoreUnitBaseTest) Test(org.junit.Test)

Example 8 with Publication

use of org.nextprot.api.core.domain.Publication in project nextprot-api by calipho-sib.

the class StatementAnnotationBuilder method findPublicationId.

long findPublicationId(Statement statement) {
    String referenceDB = statement.getValue(StatementField.REFERENCE_DATABASE);
    String referenceAC = statement.getValue(StatementField.REFERENCE_ACCESSION);
    Publication publication = publicationService.findPublicationByDatabaseAndAccession(referenceDB, referenceAC);
    if (publication == null) {
        String message = "can 't find publication db:" + referenceDB + " id:" + referenceAC;
        LOGGER.error(message);
        throw new NextProtException(message);
    }
    return publication.getPublicationId();
}
Also used : NextProtException(org.nextprot.api.commons.exception.NextProtException) Publication(org.nextprot.api.core.domain.Publication)

Example 9 with Publication

use of org.nextprot.api.core.domain.Publication in project nextprot-api by calipho-sib.

the class PublicationDaoIntegrationTest method testPubMedPublication.

@Test
public void testPubMedPublication() {
    Publication publication = publicationDao.findPublicationByDatabaseAndAccession("PubMed", "25923089");
    Assert.assertEquals("Correlation of hepcidin level with insulin resistance and endocrine glands function in major thalassemia.", publication.getTitle());
}
Also used : Publication(org.nextprot.api.core.domain.Publication) CoreUnitBaseTest(org.nextprot.api.core.test.base.CoreUnitBaseTest) Test(org.junit.Test)

Example 10 with Publication

use of org.nextprot.api.core.domain.Publication in project nextprot-api by calipho-sib.

the class PublicationDaoIntegrationTest method testOnlinePublication.

@Test
public void testOnlinePublication() {
    Publication publication = publicationDao.findPublicationById(3183821L);
    Assert.assertEquals(PublicationType.ONLINE_PUBLICATION, publication.getPublicationType());
    Assert.assertTrue(!publication.isLocalizableInBookMedium());
    Assert.assertEquals("SHMPD", publication.getPublicationResourceLocator().getName());
    Assert.assertEquals("http://shmpd.bii.a-star.edu.sg/gene.php?genestart=A&genename=BRCA1", ((WebPublicationPage) publication.getPublicationResourceLocator()).getUrl());
    Assert.assertEquals("The Singapore human mutation and polymorphism database", publication.getTitle());
}
Also used : Publication(org.nextprot.api.core.domain.Publication) CoreUnitBaseTest(org.nextprot.api.core.test.base.CoreUnitBaseTest) Test(org.junit.Test)

Aggregations

Publication (org.nextprot.api.core.domain.Publication)33 Test (org.junit.Test)17 CoreUnitBaseTest (org.nextprot.api.core.test.base.CoreUnitBaseTest)13 EntryPublication (org.nextprot.api.core.domain.publication.EntryPublication)6 Ignore (org.junit.Ignore)4 StatementSimpleWhereClauseQueryDSL (org.nextprot.api.core.dao.impl.StatementSimpleWhereClauseQueryDSL)4 ImmutableList (com.google.common.collect.ImmutableList)3 Autowired (org.springframework.beans.factory.annotation.Autowired)3 Cacheable (org.springframework.cache.annotation.Cacheable)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 PublicationAuthor (org.nextprot.api.core.domain.PublicationAuthor)2 PublicationDbXref (org.nextprot.api.core.domain.PublicationDbXref)2 GlobalPublicationStatistics (org.nextprot.api.core.domain.publication.GlobalPublicationStatistics)2 Service (org.springframework.stereotype.Service)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 Sets (com.google.common.collect.Sets)1 Argument (graphql.language.Argument)1 Field (graphql.language.Field)1