use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.
the class ByAnnotationSubjectComparatorTest method compareAnnotationsCannotFindSubjectAnnot.
@Test(expected = NextProtException.class)
public void compareAnnotationsCannotFindSubjectAnnot() throws Exception {
ByAnnotationSubjectComparator comparator = new ByAnnotationSubjectComparator(new HashMap<>());
Annotation a1 = new Annotation();
a1.setSubjectComponents(Collections.singletonList("hash1"));
Annotation a2 = new Annotation();
a2.setSubjectComponents(Collections.singletonList("hash2"));
int cmp = comparator.compare(a1, a2);
Assert.assertEquals(0, cmp);
}
use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.
the class ByAnnotationSubjectComparatorTest method mockAnnotation.
public static Annotation mockAnnotation(AnnotationCategory annotationCategory, String annotationHash) {
Annotation annotation = Mockito.mock(Annotation.class);
when(annotation.getAPICategory()).thenReturn(annotationCategory);
when(annotation.getAnnotationHash()).thenReturn(annotationHash);
return annotation;
}
use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.
the class ByAnnotationSubjectComparatorTest method compareAnnotationsUndefinedSubjectComponents.
@Test
public void compareAnnotationsUndefinedSubjectComponents() throws Exception {
ByAnnotationSubjectComparator comparator = new ByAnnotationSubjectComparator(new HashMap<>());
Annotation a1 = new Annotation();
Annotation a2 = new Annotation();
int cmp = comparator.compare(a1, a2);
Assert.assertEquals(0, cmp);
}
use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.
the class ByAnnotationSubjectComparatorTest method compareAnnotations.
@Test
public void compareAnnotations() throws Exception {
ByAnnotationSubjectComparator comparator = new ByAnnotationSubjectComparator(newHashMap(mockAnnotation(AnnotationCategory.VARIANT, "hash1"), mockAnnotation(AnnotationCategory.MUTAGENESIS, "hash2")), mockHashableComparator(0));
Annotation a1 = new Annotation();
a1.setSubjectComponents(Collections.singletonList("hash1"));
Annotation a2 = new Annotation();
a2.setSubjectComponents(Collections.singletonList("hash2"));
int cmp = comparator.compare(a1, a2);
Assert.assertEquals(0, cmp);
}
use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.
the class AnnotationClusterTest method mockAnnotation.
private static Annotation mockAnnotation(AnnotationCategory cat) {
Annotation annotation = Mockito.mock(Annotation.class);
when(annotation.getAPICategory()).thenReturn(cat);
return annotation;
}
Aggregations