Search in sources :

Example 1 with EntityName

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

the class OverviewServiceIntegrationTest method testFunctionalRegionsForP26439.

@Test
public void testFunctionalRegionsForP26439() {
    Overview overview = overviewService.findOverviewByEntry("NX_P26439");
    List<EntityName> regionNames = overview.getFunctionalRegionNames();
    Assert.assertEquals(2, regionNames.size());
    Assert.assertTrue(new EntityNameCollectionTester(regionNames).contains(Arrays.asList(mockEntityNameWithSynonymsAndOtherRecNames("Steroid Delta-isomerase", "region name", "full", Collections.singletonList(mockEntityName("Delta-5-3-ketosteroid isomerase", "region name", "full")), Collections.singletonList(mockEntityName("5.3.3.1", "EC", "EC"))), mockEntityNameWithSynonymsAndOtherRecNames("3-beta-hydroxy-Delta(5)-steroid dehydrogenase", "region name", "full", Arrays.asList(mockEntityName("3-beta-hydroxy-5-ene steroid dehydrogenase", "region name", "full"), mockEntityName("Progesterone reductase", "region name", "full")), Collections.singletonList(mockEntityName("1.1.1.145", "EC", "EC"))))));
}
Also used : EntityName(org.nextprot.api.core.domain.EntityName) Overview(org.nextprot.api.core.domain.Overview) CoreUnitBaseTest(org.nextprot.api.core.test.base.CoreUnitBaseTest) Test(org.junit.Test)

Example 2 with EntityName

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

the class OverviewServiceIntegrationTest method mockEntityNameWithSynonymsAndOtherRecNames.

private static EntityName mockEntityNameWithSynonymsAndOtherRecNames(String name, String category, String qualifier, List<EntityName> synonyms, List<EntityName> recNames) {
    EntityName entityName = mockEntityName(name, category, qualifier);
    Mockito.when(entityName.getSynonyms()).thenReturn(synonyms);
    Mockito.when(entityName.getOtherRecommendedEntityNames()).thenReturn(recNames);
    return entityName;
}
Also used : EntityName(org.nextprot.api.core.domain.EntityName)

Example 3 with EntityName

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

the class OverviewServiceIntegrationTest method testChainNamesForP51659.

@Test
public void testChainNamesForP51659() {
    Overview overview = overviewService.findOverviewByEntry("NX_P51659");
    // / chain names
    List<EntityName> chainNames = overview.getCleavedRegionNames();
    Assert.assertEquals(2, chainNames.size());
    Assert.assertTrue(new EntityNameCollectionTester(chainNames).contains(Arrays.asList(mockEntityNameWithOtherRecNames("(3R)-hydroxyacyl-CoA dehydrogenase", "protein", "full", Collections.singletonList(mockEntityName("1.1.1.n12", "chain", "EC"))), mockEntityNameWithSynonymsAndOtherRecNames("Enoyl-CoA hydratase 2", "protein", "full", Collections.singletonList(mockEntityName("3-alpha,7-alpha,12-alpha-trihydroxy-5-beta-cholest-24-enoyl-CoA hydratase", "chain", "full")), Arrays.asList(mockEntityName("4.2.1.107", "chain", "EC"), mockEntityName("4.2.1.119", "chain", "EC"))))));
}
Also used : EntityName(org.nextprot.api.core.domain.EntityName) Overview(org.nextprot.api.core.domain.Overview) CoreUnitBaseTest(org.nextprot.api.core.test.base.CoreUnitBaseTest) Test(org.junit.Test)

Example 4 with EntityName

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

the class OverviewServiceImpl method getSortedList.

private static List<EntityName> getSortedList(Multimap<Overview.EntityNameClass, EntityName> entryMap, EntityNameClass en, Comparator<EntityName> comparator) {
    List<EntityName> list = new ArrayList<>(entryMap.get(en));
    for (EntityName e : list) {
        if (e.getSynonyms() != null) {
            e.getSynonyms().sort(comparator);
        }
    }
    list.sort(comparator);
    return list;
}
Also used : EntityName(org.nextprot.api.core.domain.EntityName) ArrayList(java.util.ArrayList)

Example 5 with EntityName

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

the class OverviewServiceIntegrationTest method mockEntityName.

private static EntityName mockEntityName(String name, String category, String qualifier) {
    EntityName entityName = Mockito.mock(EntityName.class);
    Mockito.when(entityName.getQualifier()).thenReturn(qualifier);
    Mockito.when(entityName.getCategory()).thenReturn(category);
    Mockito.when(entityName.getName()).thenReturn(name);
    Mockito.when(entityName.getSynonyms()).thenReturn(Collections.<EntityName>emptyList());
    return entityName;
}
Also used : EntityName(org.nextprot.api.core.domain.EntityName)

Aggregations

EntityName (org.nextprot.api.core.domain.EntityName)19 Overview (org.nextprot.api.core.domain.Overview)8 ArrayList (java.util.ArrayList)7 Test (org.junit.Test)5 CoreUnitBaseTest (org.nextprot.api.core.test.base.CoreUnitBaseTest)4 Isoform (org.nextprot.api.core.domain.Isoform)3 Entry (org.nextprot.api.core.domain.Entry)2 MapSqlParameterSource (org.springframework.jdbc.core.namedparam.MapSqlParameterSource)2 NamedParameterJdbcTemplate (org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate)2 SqlParameterSource (org.springframework.jdbc.core.namedparam.SqlParameterSource)2 List (java.util.List)1 Family (org.nextprot.api.core.domain.Family)1 EntityNameClass (org.nextprot.api.core.domain.Overview.EntityNameClass)1 History (org.nextprot.api.core.domain.Overview.History)1 WebUnitBaseTest (org.nextprot.api.web.dbunit.base.mvc.WebUnitBaseTest)1 Cacheable (org.springframework.cache.annotation.Cacheable)1 NodeList (org.w3c.dom.NodeList)1