Search in sources :

Example 21 with Publication

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

the class PublicationServiceIntegrationTest method testPublicationByMD5.

@Test
public void testPublicationByMD5() {
    Publication publication = publicationService.findPublicationByMD5("bf9d4c981d5fb32cdcd5425e9d9226f2");
    // System.out.println(publication);
    Assert.assertTrue(publication.getFirstPage().equals("34"));
}
Also used : Publication(org.nextprot.api.core.domain.Publication) CoreUnitBaseTest(org.nextprot.api.core.test.base.CoreUnitBaseTest) Test(org.junit.Test)

Example 22 with Publication

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

the class PublicationDaoIntegrationTest method testBookPublication.

@Test
public void testBookPublication() {
    Publication publication = publicationDao.findPublicationById(15642147L);
    Assert.assertEquals(PublicationType.BOOK, publication.getPublicationType());
    Assert.assertTrue(publication.isLocalizableInBookMedium());
    Assert.assertTrue(!publication.isLocatedInScientificJournal());
    Assert.assertTrue(publication.isLocatedInEditedVolumeBook());
    Assert.assertTrue(publication.getPublicationResourceLocator() instanceof EditedVolumeBookResourceLocator);
    Assert.assertEquals("Plenum Press", publication.getPublisherName());
    Assert.assertEquals("New York", publication.getPublisherCity());
    Assert.assertEquals("Fibrinogen, thrombosis, coagulation and fibrinolysis", publication.getPublicationLocatorName());
    Assert.assertEquals("39", publication.getFirstPage());
    Assert.assertEquals("48", publication.getLastPage());
    Assert.assertEquals("1991", publication.getTextDate());
}
Also used : Publication(org.nextprot.api.core.domain.Publication) CoreUnitBaseTest(org.nextprot.api.core.test.base.CoreUnitBaseTest) Test(org.junit.Test)

Example 23 with Publication

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

the class PublicationDaoIntegrationTest method testMissingAuthors.

@Test
public void testMissingAuthors() {
    Publication publication = publicationDao.findPublicationById(3183815L);
    Assert.assertTrue(!publication.hasAuthors());
}
Also used : Publication(org.nextprot.api.core.domain.Publication) CoreUnitBaseTest(org.nextprot.api.core.test.base.CoreUnitBaseTest) Test(org.junit.Test)

Example 24 with Publication

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

the class PublicationDaoIntegrationTest method testArticlePublication.

@Test
public void testArticlePublication() {
    Publication publication = publicationDao.findPublicationById(681448L);
    Assert.assertEquals(PublicationType.ARTICLE, publication.getPublicationType());
    Assert.assertTrue(publication.isLocalizableInBookMedium());
    Assert.assertTrue(publication.isLocatedInScientificJournal());
    Assert.assertTrue(!publication.isLocatedInEditedVolumeBook());
    Assert.assertEquals("Molecular basis of fibrinogen Naples associated with defective thrombin binding and thrombophilia. Homozygous substitution of B beta 68 Ala----Thr.", publication.getTitle());
    Assert.assertEquals("1992-07", publication.getTextDate());
    Assert.assertTrue(publication.getPublicationResourceLocator() instanceof JournalResourceLocator);
    Assert.assertEquals("The Journal of clinical investigation", publication.getPublicationLocatorName());
    Assert.assertEquals("238", ((JournalResourceLocator) publication.getPublicationResourceLocator()).getFirstPage());
    Assert.assertEquals("244", ((JournalResourceLocator) publication.getPublicationResourceLocator()).getLastPage());
    Assert.assertEquals("90", ((JournalResourceLocator) publication.getPublicationResourceLocator()).getVolume());
    Assert.assertEquals("1", ((JournalResourceLocator) publication.getPublicationResourceLocator()).getIssue());
}
Also used : Publication(org.nextprot.api.core.domain.Publication) CoreUnitBaseTest(org.nextprot.api.core.test.base.CoreUnitBaseTest) Test(org.junit.Test)

Example 25 with Publication

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

the class PublicationDaoIntegrationTest method testThesisPublication.

@Test
public void testThesisPublication() {
    Publication publication = publicationDao.findPublicationById(15637368L);
    Assert.assertEquals(PublicationType.THESIS, publication.getPublicationType());
    Assert.assertFalse(publication.isLocalizable());
    Assert.assertEquals("Identification of four genes on human chromosome 3 homologous to the known genes on other chromosomes by in silico analysis", publication.getTitle());
    Assert.assertEquals("2002", publication.getTextDate());
    Assert.assertEquals("Russia", ((ThesisResourceLocator) publication.getPublicationResourceLocator()).getCountry());
    Assert.assertEquals("Novosibirsk Institute of Cytology and Genetics", ((ThesisResourceLocator) publication.getPublicationResourceLocator()).getInstitute());
}
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