use of org.nextprot.api.core.domain.annotation.AnnotationVariant in project nextprot-api by calipho-sib.
the class ByAnnotationVariantComparatorTest method mockAnnotationVariant.
private static Annotation mockAnnotationVariant(AnnotationCategory category, String original, String variant, ByIsoformPositionComparatorTest.TargetIsoform... targets) {
Annotation mock = Mockito.mock(Annotation.class);
when(mock.getVariant()).thenReturn(new AnnotationVariant(original, variant, ""));
when(mock.getAPICategory()).thenReturn(category);
Map<String, AnnotationIsoformSpecificity> map = new HashMap<>();
for (ByIsoformPositionComparatorTest.TargetIsoform target : targets) {
AnnotationIsoformSpecificity specificity = Mockito.mock(AnnotationIsoformSpecificity.class);
when(specificity.getFirstPosition()).thenReturn(target.getStart());
when(specificity.getLastPosition()).thenReturn(target.getEnd());
when(specificity.getIsoformAccession()).thenReturn(target.getIsoformAccession());
when(mock.getStartPositionForIsoform(target.getIsoformAccession())).thenReturn(target.getStart());
when(mock.getEndPositionForIsoform(target.getIsoformAccession())).thenReturn(target.getEnd());
map.put(target.getIsoformAccession(), specificity);
}
when(mock.getTargetingIsoformsMap()).thenReturn(map);
return mock;
}
use of org.nextprot.api.core.domain.annotation.AnnotationVariant in project nextprot-api by calipho-sib.
the class AnnotationVariantTest method testParse4.
public void testParse4() {
String rd = "In [GLC3A:UNIPROT_DISEASE:DI-00935]; acts as GLC1A.";
AnnotationVariant av = new AnnotationVariant("I", "L", rd);
assertEquals(av.getDescription(), "acts as GLC1A.");
assertEquals(av.getDiseaseTerms().size(), 1);
assertEquals(av.getDiseaseTerms().get(0), "DI-00935");
}
use of org.nextprot.api.core.domain.annotation.AnnotationVariant in project nextprot-api by calipho-sib.
the class AnnotationVariantTest method testParse5.
public void testParse5() {
String rd = "In [GLC3A:UNIPROT_DISEASE:DI-00935] and " + "[GLC1A:UNIPROT_DISEASE:DI-00937].";
AnnotationVariant av = new AnnotationVariant("I", "L", rd);
assertEquals(av.getDescription(), null);
assertEquals(av.getDiseaseTerms().size(), 2);
assertEquals(av.getDiseaseTerms().get(0), "DI-00935");
assertEquals(av.getDiseaseTerms().get(1), "DI-00937");
}
use of org.nextprot.api.core.domain.annotation.AnnotationVariant in project nextprot-api by calipho-sib.
the class AnnotationVariantTest method testParse2.
public void testParse2() {
String rd = "this is just a comment";
AnnotationVariant av = new AnnotationVariant("I", "L", rd);
assertEquals(av.getDescription(), "this is just a comment");
assertEquals(av.getDiseaseTerms(), null);
}
use of org.nextprot.api.core.domain.annotation.AnnotationVariant in project nextprot-api by calipho-sib.
the class AnnotationVariantTest method testParse1.
public void testParse1() {
String rd = null;
AnnotationVariant av = new AnnotationVariant("I", "L", rd);
assertEquals(av.getDescription(), null);
assertEquals(av.getDiseaseTerms(), null);
}
Aggregations