use of org.opentest4j.AssertionFailedError in project uniprot-store by ebi-uniprot.
the class GeneCentricJobIT method returnsCanonicalWithRelated.
private void returnsCanonicalWithRelated(GeneCentricDocumentConverter converter, List<GeneCentricDocument> savedDocuments) {
GeneCentricDocument document = savedDocuments.stream().filter(doc -> doc.getAccession().equals("O51971")).findFirst().orElseThrow(AssertionFailedError::new);
assertEquals("O51971", document.getAccession());
assertNotNull(document.getGeneCentricStored());
GeneCentricEntry entry = converter.getCanonicalEntryFromDocument(document);
assertNotNull(entry.getCanonicalProtein());
assertEquals("UP000000554", entry.getProteomeId());
assertEquals("O51971", entry.getCanonicalProtein().getId());
assertNotNull(entry.getRelatedProteins());
assertEquals(1, entry.getRelatedProteins().size());
Protein relatedProtein = entry.getRelatedProteins().get(0);
assertEquals("Q9HI14", relatedProtein.getId());
}
use of org.opentest4j.AssertionFailedError in project uniprot-store by ebi-uniprot.
the class GeneCentricJobIT method returnsCanonicalWithoutRelated.
private void returnsCanonicalWithoutRelated(GeneCentricDocumentConverter converter, List<GeneCentricDocument> savedDocuments) {
GeneCentricDocument document = savedDocuments.stream().filter(doc -> doc.getAccession().equals("A0A6G0ZDD9")).findFirst().orElseThrow(AssertionFailedError::new);
assertEquals("A0A6G0ZDD9", document.getAccession());
assertNotNull(document.getGeneCentricStored());
GeneCentricEntry entry = converter.getCanonicalEntryFromDocument(document);
assertNotNull(entry.getCanonicalProtein());
assertEquals("UP000478052", entry.getProteomeId());
assertEquals("A0A6G0ZDD9", entry.getCanonicalProtein().getId());
assertNotNull(entry.getRelatedProteins());
assertTrue(entry.getRelatedProteins().isEmpty());
}
use of org.opentest4j.AssertionFailedError in project uniprot-store by ebi-uniprot.
the class GeneCentricDocumentsToHDFSWriterTest method returnsCanonicalWithoutRelated.
private void returnsCanonicalWithoutRelated(GeneCentricDocumentConverter converter, List<GeneCentricDocument> savedDocuments) {
GeneCentricDocument document = savedDocuments.stream().filter(doc -> doc.getAccession().equals("A0A6G0ZDD9")).findFirst().orElseThrow(AssertionFailedError::new);
assertEquals("A0A6G0ZDD9", document.getAccession());
assertNotNull(document.getGeneCentricStored());
GeneCentricEntry entry = converter.getCanonicalEntryFromDocument(document);
assertNotNull(entry.getCanonicalProtein());
assertEquals("UP000478052", entry.getProteomeId());
assertEquals("A0A6G0ZDD9", entry.getCanonicalProtein().getId());
assertNotNull(entry.getRelatedProteins());
assertTrue(entry.getRelatedProteins().isEmpty());
}
use of org.opentest4j.AssertionFailedError in project uniprot-store by ebi-uniprot.
the class SuggestDocumentsToHDFSWriterTest method getChebi.
@Test
void getChebi() {
SuggestDocumentsToHDFSWriter writer = new SuggestDocumentsToHDFSWriter(parameter);
JavaRDD<SuggestDocument> suggestRdd = writer.getChebi(flatFileRDD);
assertNotNull(suggestRdd);
long count = suggestRdd.count();
assertEquals(30L, count);
List<SuggestDocument> catalyticDocs = suggestRdd.filter(c -> c.dictionary.equals(CATALYTIC_ACTIVITY.name())).collect();
assertEquals(10, catalyticDocs.size());
assertNotNull(catalyticDocs);
SuggestDocument document = catalyticDocs.stream().filter(c -> c.id.equals("CHEBI:23367")).findFirst().orElseThrow(AssertionFailedError::new);
assertEquals(CATALYTIC_ACTIVITY.name(), document.dictionary);
assertEquals("CHEBI:23367", document.id);
assertEquals("molecular entity", document.value);
assertEquals("medium", document.importance);
assertEquals(5, document.altValues.size());
assertTrue(document.altValues.contains("entidad molecular"));
assertTrue(document.altValues.contains("entidades moleculares"));
assertTrue(document.altValues.contains("entite moleculaire"));
assertTrue(document.altValues.contains("molecular entities"));
assertTrue(document.altValues.contains("molekulare Entitaet"));
// Make sure we add relatedIds to suggest as well
List<SuggestDocument> cofactorDocs = suggestRdd.filter(c -> c.dictionary.equals(COFACTOR.name())).collect();
assertEquals(7, cofactorDocs.size());
assertNotNull(cofactorDocs);
document = cofactorDocs.stream().filter(c -> c.id.equals("CHEBI:2500")).findFirst().orElseThrow(AssertionFailedError::new);
assertEquals(COFACTOR.name(), document.dictionary);
assertEquals("CHEBI:2500", document.id);
assertEquals("2500-fluoroethyl methanesulfonate", document.value);
assertEquals("medium", document.importance);
assertEquals(2, document.altValues.size());
assertTrue(document.altValues.contains("2500-synonym"));
assertTrue(document.altValues.contains("AABBBCCCDD-IIHHHHGGGFFFF-N"));
List<SuggestDocument> chebiDocs = suggestRdd.filter(c -> c.dictionary.equals(CHEBI.name())).collect();
assertNotNull(chebiDocs);
document = chebiDocs.stream().filter(c -> c.id.equals("CHEBI:2500")).findFirst().orElseThrow(AssertionFailedError::new);
assertEquals(CHEBI.name(), document.dictionary);
assertEquals("CHEBI:2500", document.id);
assertEquals("2500-fluoroethyl methanesulfonate", document.value);
assertEquals("medium", document.importance);
assertEquals(2, document.altValues.size());
assertTrue(document.altValues.contains("2500-synonym"));
assertTrue(document.altValues.contains("AABBBCCCDD-IIHHHHGGGFFFF-N"));
assertEquals(13, chebiDocs.size());
List<String> chebiIds = chebiDocs.stream().map(SuggestDocument::getDocumentId).collect(Collectors.toList());
List<String> cofactorIds = cofactorDocs.stream().map(SuggestDocument::getDocumentId).collect(Collectors.toList());
List<String> catalyticIds = catalyticDocs.stream().map(SuggestDocument::getDocumentId).collect(Collectors.toList());
assertTrue(chebiIds.containsAll(cofactorIds));
assertTrue(chebiIds.containsAll(catalyticIds));
}
use of org.opentest4j.AssertionFailedError in project uniprot-store by ebi-uniprot.
the class ProteinsWithTest method validFeatureFromEnumDisplay.
@Test
void validFeatureFromEnumDisplay() {
EnumDisplay enumDisplay = UniprotKBFeatureType.CARBOHYD;
ProteinsWith proteinsWith = ProteinsWith.from(enumDisplay).orElseThrow(AssertionFailedError::new);
assertEquals(26, proteinsWith.getValue());
assertEquals(enumDisplay.getName(), proteinsWith.getEnumDisplay().getName());
}
Aggregations