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"))))));
}
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;
}
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"))))));
}
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;
}
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;
}
Aggregations