Search in sources :

Example 1 with History

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

the class HistoryDaoTest method testFindHistoryEntry.

@Test
public void testFindHistoryEntry() {
    List<History> histories = this.historyDao.findHistoryByEntry("PAM");
    assertEquals(1, histories.size());
    History history = histories.get(0);
    assertEquals("Evidence_at_protein_level", history.getProteinExistenceUniprot().getDescriptionName());
    assertEquals("2010-03-01", history.getFormattedNextprotIntegrationDate());
    assertEquals("2013-06-15", history.getFormattedNextprotUpdateDate());
    assertEquals("2006-10-31", history.getFormattedUniprotIntegrationDate());
    assertEquals("2013-04-03", history.getFormattedUniprotUpdateDate());
    assertEquals("1", history.getSequenceVersion());
}
Also used : History(org.nextprot.api.core.domain.Overview.History) CoreUnitBaseTest(org.nextprot.api.core.test.base.CoreUnitBaseTest) Test(org.junit.Test)

Example 2 with History

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

the class OverviewServiceImpl method findOverviewByEntry.

@Override
@Cacheable("overview")
public Overview findOverviewByEntry(String uniqueName) {
    Overview overview = new Overview();
    List<History> history = this.historyDao.findHistoryByEntry(uniqueName);
    if (history != null && history.size() != 0)
        overview.setHistory(history.get(0));
    List<EntityName> entityNames = this.entryNameDao.findNames(uniqueName);
    entityNames.addAll(entryNameDao.findAlternativeChainNames(uniqueName));
    setNamesInOverview(entityNames, overview);
    overview.setFamilies(this.familyService.findFamilies(uniqueName));
    overview.setIsoformNames(convertIsoNamestoOverviewName(isoformService.findIsoformsByEntryName(uniqueName)));
    overview.setProteinExistences(proteinExistenceService.getProteinExistences(uniqueName));
    return overview;
}
Also used : EntityName(org.nextprot.api.core.domain.EntityName) Overview(org.nextprot.api.core.domain.Overview) History(org.nextprot.api.core.domain.Overview.History) Cacheable(org.springframework.cache.annotation.Cacheable)

Aggregations

History (org.nextprot.api.core.domain.Overview.History)2 Test (org.junit.Test)1 EntityName (org.nextprot.api.core.domain.EntityName)1 Overview (org.nextprot.api.core.domain.Overview)1 CoreUnitBaseTest (org.nextprot.api.core.test.base.CoreUnitBaseTest)1 Cacheable (org.springframework.cache.annotation.Cacheable)1